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

3 ビュー (過去 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!