How to plot 3 garph in one figure?

조회 수: 2 (최근 30일)
Matmien
Matmien 2011년 12월 3일
How to plot 3 garph in one figure?

답변 (2개)

Junaid
Junaid 2011년 12월 3일
Well, if you want to draw three different graph figures into one figure then you can use subplot.
ex: let say I have two graphs and I want them to see adjacent.
subplot(1,2,1), plot([1:10]);
subplot(1,2,2), plot([11:2:30]);
or if you want three different graph only in one figure then doc hold as Grzegorz suggest above.
ex
plot([1:10],'r'); hold on;
plot([11:2:30],'b');
  댓글 수: 2
Matmien
Matmien 2011년 12월 3일
it overlap? or 2 different graph?
Junaid
Junaid 2011년 12월 3일
Second example will show two graphs in one figure, whereas first example will show two graph on two different figures but still in one window. you can execute the code.
try this code.
plot([1:10],'b'); hold on;
plot([11:2:30],'r');
you will see two graph of two different colors.

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


Grzegorz Knor
Grzegorz Knor 2011년 12월 3일

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by