Clear Filters
Clear Filters

how to plot multiple curves on one graph

27 views (last 30 days)
andrew
andrew on 13 Jan 2012
Hi,
I want to graph multiple curves on one graph. For example, one curve looks like:
x = [2,2,2,2,2]; (this represents number of vehicles)
y = [5,10,15,20,25]; (this represents number of nodes)
z = [6.3, 8.2, 7.3, 14.1, 73.4]; (this represents time taken)
This creates a curve that looks exponential, but I want to also overlay other curves like the following onto it (the overall graph should look almost like a ramp and a plot that shows the contour or surface would even be better).
x = [3,3,3,3,3];
y = [5,10,15,20,25];
z = [7.3, 10.2, 11.3, 22.1, 90.4]
Furthermore, if there is a way to fit an exponential curve to this, that would be even better.
Thank you so much for your help
Drew

Answers (1)

Walter Roberson
Walter Roberson on 13 Jan 2012
plot3(x1,y1,z1,'b*-',x2,y2,z2,'ro:');
or
plot3(x1,y1,z1,'b*-');
hold on
plot3(x2,y2,z2,'ro:');

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!