Plot multiple graphs on the figure using plot(y,linespec)

조회 수: 17 (최근 30일)
a2zee
a2zee 2024년 9월 4일
편집: Voss 2024년 9월 23일
figure();
plot(y_vec_1,'*-r');gz;
xlabel('Wrap Around #'); ylabel('Time (Sec)');
How can I plot a second graph on the same figure? Also y_vec_x's dimension varies a bit.
plot(y_vec_2,'*-b');gz;
plot(y_vec_3,'*-g');gz;
Thanks

채택된 답변

Voss
Voss 2024년 9월 4일
y_vec_1 = rand(1,10);
y_vec_2 = rand(1,15);
y_vec_3 = rand(1,20);
figure();
plot(y_vec_1,'*-r');%gz;
hold on
xlabel('Wrap Around #'); ylabel('Time (Sec)');
plot(y_vec_2,'*-b');%gz;
plot(y_vec_3,'*-g');%gz;
  댓글 수: 2
a2zee
a2zee 2024년 9월 4일
It works! Thank you.
Voss
Voss 2024년 9월 4일
편집: Voss 2024년 9월 23일
You're welcome! Any questions, let me know.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by