The reason is because Show
only use the options from the first graphic. Therefore, if you put tplot before splot, the range would be taken as that of tplot (2 to 10.3), and you would not be able to see the {1,0.2} point from splot. Conversely, if splot is in front, the plot follows the y range of splot, which only goes up to 0.33. Therefore, you would not see tplot because it does not fall into that y range.
To fully display the plots of both, you can specify the plot range of the ListPlot
or ListLinePlot
that is in front to include the range of the second one, using PlotRange
(or the more limited DataRange
). For example:
splot = ListPlot[s, PlotStyle -> Red, PlotRange -> {{0, 11}, {0, 4}}];
tplot = ListPlot[t];
Show[splot, tplot]
This was what belisarius did in his answer but I think he went one step further and specify the range so that there's no extra space beyond the plot points.
You can also specify Show
itself since any options in Show
will overwrite the options in the individual plots. Again, use PlotRange
, or DataRange
.
tplot = ListPlot[t];
splot = ListPlot[s, PlotStyle -> Red];
Show[splot, tplot, PlotRange -> {{0, 11}, {0, 4}}]
Lastly, you can just use ListPlot
or ListLinePlot
for both lists (s and t) since they are capable of plotting multiple lists of data points. The plot will automatically include all the points in both lists.
ListPlot[{t, s}]
