Axis for Plotyy for Multiple plots
28 次查看(过去 30 天)
显示 更早的评论
Hello,
I'm using Plotyy as
[haxes(1:2),hline1,hline2] = plotyy(x1,y1,x1,y2);
set(haxes(1:2),'NextPlot','add');
plot(haxes(1),x1,y3,'-r','LineWidth',1.5)
plot(haxes(2),x1,y4,'-blue','LineWidth',1.5)
%Now I'm setting for a Region of Interest(ROI) plot
axis([28 38 -1000 1000])
The Problem is when I set the axis, it is showing the zoomed/ ROI of the last 2 plots of y3 and y4, but not the ROI for y1 and y2. (Its not setting the axes automatically for the x1,y1 and x2,y2) Please suggest me how to proceed. Thanks in Advance
0 个评论
采纳的回答
dpb
2016-5-15
编辑:dpb
2016-5-16
[hAx,hL1,hL2] = plotyy(x1,y1,x1,y2);
set(hAx,'NextPlot','add')
plot(hAx(1),x1,y3,'-r','LineWidth',1.5)
plot(hAx(2),x1,y4,'-blue','LineWidth',1.5)
linkaxes(hAx) % key missing ingredient...link the axes you want same
axis(hAx(1), [28 38 -1000 1000]) % now all axes in hAx will stay in synch with hAx(1)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Two y-axis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!