translating data coordinates to figure coordinates
2 次查看(过去 30 天)
显示 更早的评论
I've got a rectangle defined in data coordinates, trying to use dragrect to accurately move that rectangle elsewhere and redefine the rectangle a different location. My problem is translating data coordinates into figure coordinates for dragrect.
I used ds2nfu for a while, and it gets close, but I use daspect([1 1 1]) and get(gca,'Position') doesn't properly get the normalized axes size when one axis is smaller due to the aspect ratio constraint.
Everything I've tried is 'close' but I can't quite seem to get the proper scale factor for shrinking the constrained axis because get(gca,'TightInset') always gives a '0' when there is more room in an axes' width or height than it actually takes up (since there is no needed additional margin).
It'd be nice if get(gca,'TightInset') gave negative values, so you could properly determine exactly how wide an axis that is constrained by daspect is.
The other question is, have I been blind to an easier way to get this information?
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Labels and Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!