Filter löschen
Filter löschen

translating data coordinates to figure coordinates

2 Ansichten (letzte 30 Tage)
Matthew Lang
Matthew Lang am 14 Mär. 2012
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?

Antworten (0)

Kategorien

Mehr zu Labels and Annotations finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by