How to plot three y-axes in one figure, where each one y-axis have three lines to be plotted?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
0 commentaires
Réponses (1)
sloppydisk
le 31 Mai 2018
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?
Voir également
Catégories
En savoir plus sur Subplots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!