フィルターのクリア

translating data coordinates to figure coordinates

2 ビュー (過去 30 日間)
Matthew Lang
Matthew Lang 2012 年 3 月 14 日
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 件)

カテゴリ

Help Center および File ExchangeLabels and Annotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by