Suppose that we have these two series:
First_Series = [1, 1200; 2,1300; 3,100; 5,267; 6,2674; 7,1346];
Second_Series = [8, 1340; 9,2100; 10,1100];
In both series first column is x-axis and second column is y-axis. I want these two series in a same line-plot with different colors.
figure
; This creates a window to plot the graph plot
on the first one, this will plot the first series hold on;
this holds the previously plotted graph window When you issue the command hold off;
it will release the graph window. New plots will go to a new graph window.
Here's an example with your data set plotting red and green lines for the two series:
figure;
plot(First_Series(:,1), First_Series(:,2), 'r');
hold on;
plot(Second_Series(:,1), Second_Series(:,2), 'g');
hold off;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.