get(axH,'position') reporting incorrect values?
Show older comments
hi all. it appears that getting an axes 'position' will sometimes report incorrect values.
here is how i produce reliably:
figure;ax1 = axes('xcolor','m','ycolor','m');
ax2 = axes('position',[0 0 1 1],'color','none');
rPosition = rectangle('parent',ax2,'position',get(ax1,'position'),'edgecolor','k');
rectangle shows up in wrong place:

but if i subsequently draw a rectangle at outerposition, all of a sudden the position/black rectangle is in the right place:
rOuter = rectangle('parent',ax2,'position',get(ax1,'outerposition'),'edgecolor','r');

edit: actually drawing any subsequent rectangle in ax2 in a position set as either get(ax1,'outerposition') or 'tightinset' will re-position the first rectangle properly
interestingly, if i get(ax1,'position') before and after the second rectangle is drawn i get the same values:
[0.1300 0.1100 0.7750 0.8150]
ideas? thanks
7.9.1.671 (R2009b) Service Pack 1 (linux 64bit)
Accepted Answer
More Answers (0)
Categories
Find more on Graphics Object Properties in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!