Help with multiple plots and axis
4 次查看(过去 30 天)
显示 更早的评论
Hi,
I'm trying to find information on how to plot 5 different plots on the same plot, but using the left y-axis for 2 of them and the right y-axis for 3 of them. They are very different in scale and so I need them to be overlapped but tied to different scales. I've seen quite a few videos and forum posts on how to do multiple graphs OR multiple axis but I haven't seen anything on doing both at the same time. I've tried combining both but I keep getting errors. Any help is greatly appreciated.
Thanks.
0 个评论
回答(1 个)
Andrew Bliss
2014-10-15
Something like this might work:
figure
ax(1)=axes; hold on
ax(2)=axes; hold on
set(ax(2),'YAxisLocation','right','color','none','xcolor','r','ycolor','r')
plot(ax(1),1:10,rand(1,10))
plot(ax(1),1:10,.3*rand(1,10),'.')
plot(ax(1),1:10,.6*rand(1,10),'+')
plot(ax(2),1:10,50*rand(1,10),'r')
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!