MATLAB Answers

Plotting different colours

23 views (last 30 days)
Hi Guys,
So I need to plot these three vectors -
1 has 100 elements, 2 has 598 and 3 has 100. I combine them into one. And then I generate a cumulative time axis and plot them. but I need the three vectors to be plotted in different colours. How do I do that?


Sign in to comment.

Accepted Answer

Sean de Wolski
Sean de Wolski on 1 Sep 2011
hold on
They key is to use hold on with separate calls to plot. Or to do all of the plotting in one line with different markers:
plot(x1,y1,'b-',x2,y2,'r-'); %etc.

  1 Comment

Abhilash on 1 Sep 2011
Great, thanks!!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!