how to plot with double y-axis?
显示 更早的评论
Hello, Below is my code for producing double y-axis plot. on the left axis, i have discharge data while on the right axis I have precipitation in reverse direction. i would like to increase the space in between. Also, need to further subdivide the y-axis on both sides as well as labeling both y-axis. any help would be appreciated.
figure()
[AX,H1,H2] =plotyy(x,Mean_Gauge4,x,Mean_prec,'bar','bar');
set(AX(2),'YDir','reverse')
set(H1,'FaceColor','r','barwidth',0.3)
set(H2,'FaceColor','b','barwidth',0.3)
axis(AX(1), 'tight');
axis(AX(2), 'tight');
alpha(AX(2), .5)
set(gca,'xtick',1:12,'xticklabel',{'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'})

回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Axis Labels 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!