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

3 ビュー (過去 30 日間)
george mobol
george mobol 2016 年 8 月 31 日
回答済み: Sean de Wolski 2016 年 8 月 31 日
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];

採用された回答

Sean de Wolski
Sean de Wolski 2016 年 8 月 31 日
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.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTwo y-axis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by