フィルターのクリア

how to plot with double y-axis?

1 回表示 (過去 30 日間)
Hydro
Hydro 2017 年 10 月 14 日
編集済み: Hydro 2017 年 10 月 14 日

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'})
  1 件のコメント
Hydro
Hydro 2017 年 10 月 14 日
編集済み: Hydro 2017 年 10 月 14 日
hello, I figure it out. here is the code in case someone needs it.
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');
set(AX(2),'YLim',[0 150],'YTick',[0:10:150])
set(AX(1),'YLim',[0 50],'YTick',[0:10:50])
box(AX(1),'off'
alpha(AX(2), .5)
set(gca,'xtick',1:12,'xticklabel',{'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'})

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeLegend についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by