フィルターのクリア

Plot 3 lines using plotyy

13 ビュー (過去 30 日間)
David du Preez
David du Preez 2017 年 8 月 15 日
編集済み: dpb 2017 年 8 月 16 日
Using plotyy. I want to plot 2 lines on the left y axis and 1 line on the right y axis. I tried something like this but it didn't work. Y and Y2 should be on the left y axis
x =SZA15_Sort(:,1);
y =SZA15_Sort(:,9);
y1=SZA15_Sort(:,5);
y2 =SZA15_Sort(:,11);
[ax h1 h2]=plotyy(x,y,x,y1);
hold(ax(1))
plot(ax(1),x,y2)

採用された回答

dpb
dpb 2017 年 8 月 15 日
編集済み: dpb 2017 年 8 月 16 日
[hAx hL1 hL2]=plotyy(x,[y(:) y2(:)],x,y1);
NB: The colon on the y is to ensure are column vectors for the concatenation...if they already are, is unneeded. Or, concatenate by row w/ the semicolon instead.
ADDENDUM Presuming you have R2016a or newer use <yyaxis> instead; yyplot has been deprecated.

その他の回答 (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