# Combining multiple ListPlot with different abscissas

I have a complicated function and my computer crashes when I try to plot it using ListPlot from 0 to 30.

So what I want to do is instead of plotting the function from 0 to 30, I cut it into segments, i.e. 0 to 3, 3 to 6, and so on, then I want to combine all these segments.

How do I combine these segments?

Thank you

• Do you understand why it crashes? – mikado Oct 17 '16 at 5:34
• I think my computer crashes because it ran out of memory – PhilCsar Oct 17 '16 at 5:40
• This is how to do what you asked. list1 = Table[{x, x^2}, {x,0,3}]; list2 = Table[{x, x^2}, {x,3,6}]; list3 = Table[{x, x^2}, {x,6,9}]; ListPlot[{list1, list2, list3}] but I question whether that will really solve your problem. – Bill Oct 17 '16 at 5:59
• I tried this and it works. Thanks! How do I make the different segments into the same color and linestyle? – PhilCsar Oct 17 '16 at 6:01
• Study this hint: ListPlot[{list1, list2, list3}, PlotStyle -> Red] – Bill Oct 17 '16 at 6:11

You can use Show with PlotRange->All

plots = Table[ListPlot[Table[{x, Sin[x]}, {x, a, a + 2, 0.1}],
PlotStyle -> Hue[a/10]], {a, 0, 6, 2}] Show[plots, PlotRange -> All] You could also try to build lines from values and then use Show@Graphics[{specifications, lines}, options], which I think gives you more control. Table[ ] would also let you use a larger step so you do not run into memory issues. For example line1=Line@Table[{z,function[z]}, {z, min, max, step}] plt1=Show@Graphics[{ Dashing[.02], Black, line1 },Axes->True]