1
$\begingroup$

I am facing a problem but Suppose just for an example below, i am mentioning the dummy code of the problem;

Tab1 = Table[{x, x^2}, {x, 0.1, 10}];p1 = ListLinePlot[Tab1, Frame -> True]; Tab2 =  Table[{x, x^2 - 3}, {x, 0.25, 12}]; p2 = ListLinePlot[Tab2, Frame -> True, PlotStyle -> Dashed];Tab3 = Join[Tab1, Tab2];

so i use the join command, But what i want is sum of these two curves
as a one curve .

p3 = ListLinePlot[Tab3, Frame -> True, PlotStyle -> Directive[Red]]

But this gives me two same curves. Anyone here who knows how to handle?

$\endgroup$

1 Answer 1

5
$\begingroup$

Try Interpolation

ip1 = Interpolation[Tab1]
ip2 = Interpolation[Tab2]
Show[{Plot[ip1[x] + ip2[x], {x, 0.1, 9.1}], ListPlot[{Tab1, Tab2}]},PlotRange->All]

enter image description here

$\endgroup$
2
  • $\begingroup$ thank you ulrich $\endgroup$
    – Immy Salam
    Dec 10, 2023 at 13:36
  • $\begingroup$ You are welcome! $\endgroup$ Dec 10, 2023 at 13:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.