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!