Plot multiple axis in same plot (not plotyy)
12 次查看(过去 30 天)
显示 更早的评论
I want to plot only one vector with two Y axes. One axe will indicate "samples" and the other "time" (since each sample is actually some instant). I mean, the two axes are just proportional. I need both information in the same plot.
With plotyy (or creating "child" axes for a "parent figure") you then have to plot twice the same vector. One time for each axe.
But I wonder if there's an easier way, beacuse I want to use mesh and imagesc plotts and is inefficient to plot same vector twice in same figure.
thanks in advance
0 个评论
回答(1 个)
Walter Roberson
2011-12-25
You will still need multiple axis, as the tick labels apply to the whole axis. You should, however, not need to actually plot anything in the second axis, as you can set the axis ylim to the range you need.
It is probably easiest to still use plotyy() to set things up. You can plot just the min y to the max y but in "time" units. Then you can set set the ylim for that axis, and then you can remove the line object of the two points.
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!