translating data coordinates to figure coordinates

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개)

카테고리

도움말 센터File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

질문:

2012년 3월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by