How to plot two plotyy plots in the same plot
古いコメントを表示
I am trying to plot four plots in the same figure. First i plot using plotyy. Then two graphs are created, each with a yaxis.
Now I want to plot another two plots. One using yaxis-1 and one using yaxis-2. How do i do this?
If I do
[ax,h1,h2] = plotyy(...)
hold on
plot(ax(1),...)
plot(ax(2),...)
i don't get all four plots.
Thanks :)
Ben
採用された回答
その他の回答 (2 件)
the cyclist
2011 年 8 月 15 日
figure
[hax12 line1 hline2] = plotyy(1:10,1:10,1:10,2:11)
set(hax12,'NextPlot','add')
plot(hax12(1),1:10,3:12)
plot(hax12(2),1:10,4:13)
5 件のコメント
Benjamin
2011 年 8 月 15 日
Manimaran Kanesan
2013 年 6 月 18 日
Thank you....
Paulo F.
2014 年 9 月 27 日
Thanks, this saved me a second day of trials!
Rajeev Yadav
2015 年 6 月 5 日
i tried this but it doesnt work in 2015a
Soroush
2015 年 7 月 17 日
Thanks!
Nir Dahan
2015 年 8 月 25 日
0 投票
try this one where all vectors are column, of size (N,1)
[ax,h1,h2]=plotyy([x,x,x,...],[y1,y2,y3,...],[X,X,X,...],[Y1,Y2,Y3,...])
カテゴリ
ヘルプ センター および File Exchange で Two y-axis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!