How to plot three y-axes in one figure, where each one y-axis have three lines to be plotted?

조회 수: 2 (최근 30일)
How to plot 3 y-axes in one figure, where each one y-axis have 3 lines to be plotted? Something like Fig below for which I have used the addaxis function, however, I can only plot one line for the 3rd y-axis. May I know how to plot 3 lines for 3rd y-axis?
x=1:5;
y11=[2 3 4 5 6];
y12=[2 3 2 1 3];
y13=[2 3 4 5 2];
y21=[2 1 1 1 3];
y22=[1 2 1 2 3];
y23=[4 5 2 1 2];
y31=[3 3 2 4 5];
y32=[2 1 14 5 6];
y33=[11 3 4 5 2];
figure;
plot(x,y11,y12,y13);%1st y-axis
plot(x,y21,y22,y23);%2nd y-axis
plot(x,y31,y32,y33);%3rd y-axis

답변 (1개)

sloppydisk
sloppydisk 2018년 5월 31일
Check out
doc subplot
For your example:
figure(1);
subplot(3, 1, 1)
plot(x,y11,y12,y13);%1st y-axis
subplot(3, 1, 2)
plot(x,y21,y22,y23);%2nd y-axis
subplot(3, 1, 3)
plot(x,y31,y32,y33);%3rd y-axis
I assume this is what you're talking about?
  댓글 수: 1
Chaoyang Jiang
Chaoyang Jiang 2018년 5월 31일
Thank you for your answer, I mean at the same figure, not in the form of subplot. I have attached the expecting figure in the question.

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by