v1 = {}; v2 = {};
For[t = 0, t < 100, t = t + 1,
y = 2 t + 3;
z = 4 t - 8;
AppendTo[v1, {t, y}];
AppendTo[v2, {t, z}];
]
This program generates two distinct lists. Named as “v1” and “v2” having elements in the form of {t,y}, {t,z} respectively. Now I wish to plot the Lists “v1” and “v2” on a same single graph having “t” variable on x - axis.
I do not understand how that is not working as per the requirement.
Now I wish to plot the Lists “v1” and “v2” on a same single graph having “t” variable on x - axis.
v1 and v2 are in the same single graph. The time is on the x-axis. This seems to do exaclty what you want. What is the requirement that it does not fulfil?
Respected @Marco Thiel and @Girish Arabale,
Thanks for ur reply,
This Mathod is appropriate when The range on Y- axis of both the Graphs are Compatible with each other.
But In case when the range of both the Lists vary conciderably , then we persist a problem…
v1 = {}; v2 = {};
For[t = 0, t < 100, t = t + 1, y = 2 t^3 + 3;(*I have replaced "y = 2 t + 3" with "y = 2 t^3 + 3"*)
z = 4 t - 8;
AppendTo[v1, {t, y}];
AppendTo[v2, {t, z}];]
Show[{ListPlot[v1], ListPlot[v2]}, PlotRange -> All]
Respected @Marco Thiel and @Girish Arabale,
Thanks for ur reply,
This Mathod is appropriate when The range on Y- axis of both the Graphs are Compatible with each other.
But In case when the range of both the Lists vary conciderably , then we persist a problem…
v1 = {}; v2 = {};
For[t = 0, t < 100, t = t + 1, y = 2 t^3 + 3;(*I have replaced "y = 2 t + 3" with "y = 2 t^3 + 3"*)
z = 4 t - 8;
AppendTo[v1, {t, y}];
AppendTo[v2, {t, z}];]
Show[{ListPlot[v1], ListPlot[v2]}, PlotRange -> All]
The advantage of your method is that the curves do not look “distorted”. But if you get used to the logarithmic represenation it is actually easy to read and there is the advantage that one can more easily compare the values of the two curves on a sigle axis.
I do not believe this capability exists in Mathematica 9, at least not without a great deal of custom graphics programming. However, I think it would be a very valuable enhancement, which I have in the past requested of our friends at WRI,
At one time, it was common to display such data sets together by introducing different axes. For two data sets it was common to have separate axes on the left and right sides. For more than two data sets this becomes cluttered. Today, a form of stacked graph finds more favor. Below is a clip from the web:
If these data were graphed using the same y-axis, the features would be less obvious. There are of course more extreme examples. Placing them on a Log graph would produce a different view, and a data set that contains negative values can never be shown on a log graph.
I would dearly love to see capabilites like this added to Mathematica as built in capabilities.