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

采纳的回答

dpb
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'))
  1 个评论
Win co
Win co 2014-6-10
Big thank for your attention to my problem. I've tried this tip and it seems to work correctly by now.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Two y-axis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by