Effacer les filtres
Effacer les filtres

How do i plot and label a graph using secondary axis in matlab

2 vues (au cours des 30 derniers jours)
george mobol
george mobol le 31 Août 2016
Hello, I'm trying to plot and label two vertical axes for (A and B) of different scales against the same horizontal axis (U).
U=[1 2 3 4 5 6 7 8];
A=[0.0141 0.0135 0.013 0.0125 0.012 0.0117 0.0113 0.011];
B=[0.142267 0.14271177 0.1430866 0.14334375 0.14357196 0.143885125 0.144042862 0.14423808];

Réponse acceptée

Sean de Wolski
Sean de Wolski le 31 Août 2016
U=[1 2 3 4 5 6 7 8];
A=[0.0141 0.0135 0.013 0.0125 0.012 0.0117 0.0113 0.011];
B=[0.142267 0.14271177 0.1430866 0.14334375 0.14357196 0.143885125 0.144042862 0.14423808];
yyaxis left
plot(U,A)
yyaxis right
plot(U,B)
If you're on an older release without yyaxis, then look at plotyy or upgrade.

Plus de réponses (0)

Catégories

En savoir plus sur Two y-axis 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!

Translated by