View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

4.4 | 7 ratings Rate this file 14 Downloads (last 30 days) File Size: 2.08 KB File ID: #13634 Version: 1.0



Benoît Valley (view profile)


11 Jan 2007 (Updated )

Transform axes coordinates in current figure units coordinate.

| Watch this File

File Information

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

Acknowledgments are due to Scott Hirsch ( 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'.


Data Space To Figure Units Conversion inspired this file.

MATLAB release MATLAB 7.1.0 (R14SP3)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (7)
13 Oct 2016 Amihay Blau

Very helpful, thanks!

01 Sep 2016 Jon Adsersen

Great function! Just what i Needed!

20 Jun 2014 bi yunfeng

02 May 2012 Charlie

This is a much needed function and works well. Thank you.

It would be great if the reference in the matlab manual to dsxy2figxy could be changed to mention this function. I wasted a lot of time trying to work out what was going on with dsxy2figxy. Even would be helpful if this function was included in matlab. How does this kind of decision get made?

Also, would be good if the function could work irrespective of the figure units, not just for normalised units.

21 May 2010 Lorgio Teodovich


24 Apr 2009 Tim

Tim (view profile)

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) ? :-)

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').

Contact us