how to plotyy axis equal
2 ビュー (過去 30 日間)
古いコメントを表示
hello, is there an equivalent code for AXIS EQUAL for plotyy ? My concern is that when I use grid on, the dashed lines are not superposed on left side axis and right side axis. So it seems I need to rebuild the tick labels to have the same spacing unit on left and right side axis ticks. Any suggestions ? yours
0 件のコメント
回答 (1 件)
vijaya lakshmi
2018 年 2 月 8 日
Hi Hideki,
I understand that you want to superimpose the dashed lines on both the Y-axes when using grid on.
The grid lines superimposes if the number of levels/divisions on both the Y-axes are same.
Try the following code snippet where the grid lines are superimposed
x = linspace(0,10);
y = sin(3*x);
z = sin(3*x).*exp(0.5*x);
[haxes,hline1,hline2] = plotyy(x,y,x,z);
set(haxes(2),'Xgrid','on')
set(haxes(2),'Ygrid','on')
set(haxes(1),'ylim',[-1 1])
set(haxes(2),'ylim',[-130 130])
set(haxes(2),'ytick',[-130:10:130])
% you can then for instance add a grid to the first axes as well
set(haxes(1),'ytick',linspace(-1,1,27))
set(haxes(1),'Xgrid','on')
set(haxes(1),'Ygrid','on')
If the number of levels are different, try adjusting the spacing between the levels
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!