필터 지우기
필터 지우기

Plotting different colours

조회 수: 1 (최근 30일)
Abhilash
Abhilash 2011년 9월 1일
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?
Thanks

채택된 답변

Sean de Wolski
Sean de Wolski 2011년 9월 1일
figure;
hold on
plot(1:100,x(1:100),'b-');
plot(101:(101+597),x(101:(101+597)),'r-');
%etc.
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
Abhilash
Abhilash 2011년 9월 1일
Great, thanks!!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by