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

조회 수: 7(최근 30일)
Chaoyang Jiang 2018년 5월 31일
댓글: Chaoyang Jiang 2018년 5월 31일
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 2018년 5월 31일
Check out
doc subplot
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 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.

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

### Community Treasure Hunt

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

Start Hunting!