offset between 2 axes when using plotyy
1 回表示 (過去 30 日間)
古いコメントを表示
Hi everyone, I have a problem of plotyy display. In fullscreen mode, 2 axes are superimposed correctly, when I try to modify some details with "plot tools and dock figure" (eg: label size) and re-display the figure in fullscreen mode, there is an offset between 2 axes (cf. fig). I would like to know how to re-fix axes position?
Kind regards, Winn
0 件のコメント
採用された回答
dpb
2014 年 6 月 10 日
編集済み: dpb
2014 年 6 月 10 日
Never seen that symptom before; then again I don't use the plot tools menu much.
It looks like somehow dragged the RH axes lower position or perhaps there's an automated adjustment of spacing when change the font size drastically.
In modifying plotyy properties, one needs must remember there are two independent axes overlaid so have to make sure whatever happens to change the position or properties of one are reflected on the other relative to positions, x-ticks, etc., ...
To fix this, retrieve the 'position' coordinates of each axes and reset the bottom and height values (2nd and 4th entries) of the RH axes to those of the left. I'll assume you have the two axes handles as hA --
p1=get(hA(1),'position'); % LH axes position
p2=get(hA(2),'position'); % and RH...
p2(2)=p1(2); p2(4)=p1(4); % fixup the RH bottom, height
set(hA(2),'position',p2) % and reset
ADDENDUM
Actually, the above is far more complex than needs be--simply reset the RH to the LH values (or vice versa, depending on which one wants to keep)--
set(hA(2),'position',get(hA(1),'position'))
その他の回答 (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!