4.0

4.0 | 2 ratings Rate this file 21 downloads (last 30 days) File Size: 2.08 KB File ID: #13634

axescoord2figurecoord

by Benoît Valley

 

11 Jan 2007 (Updated 11 Jan 2007)

Code covered by BSD License  

Transform axes coordinates in current figure units coordinate.

Download Now | Watch this File

File Information
Description

Transform axes coordinates in current
figure units coordinate. Useful for annotation location.

Acknowledgments are due to Scott Hirsch (shirsch@mathworks.com) for is
function ds2nfu. Some part of the present function derived from ds2nfu.

The advantage of the present function comparing to ds2nfu is that it managed problems occurring with various 'DataAspectRatioMode' and 'PlotBoxAspectRatioMode' as well as reverse 'XDir' or 'YDir'.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Data space to figure units conversion

MATLAB release MATLAB 7.1.0 (R14SP3)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
16 Aug 2008 Dietmar Reschner

I'd like to thank the author for posting this file.

The function axescoord2figurecoord can be used instead of matlab's 'dsxy2figxy' when transforming from axis to figure coordinates and your 'PlotBoxAspectRatio' differs from [1 1 1].
Note for users! Only works with figure units set to normalized, like: set(gcf,'Units','normalized').

24 Apr 2009 Tim

If an annotation object is moved manually, and the new location needs to be extracted, then the opposite conversion is necessary. Would someone like to write it (in the same rigorous way as here, taking PlotBoxAspectRatio and DataAspectRatio into account) ? :-)

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
annotation Benoît Valley 22 Oct 2008 08:56:44
customization Benoît Valley 22 Oct 2008 08:56:44
figure coordinate Benoît Valley 22 Oct 2008 08:56:44
axes coordinate Benoît Valley 22 Oct 2008 08:56:44
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com