5.0

5.0 | 2 ratings Rate this file 146 downloads (last 30 days) File Size: 31.42 KB File ID: #18607

SETAXES

by Mukhtar Ullah

 

04 Feb 2008 (Updated 20 Oct 2008)

No BSD License  

creates handles of nested functions for fixing problems with MATLAB figures.

Download Now | Watch this File

File Information
Description

This subsmission was inspired by the blog:
http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/

% SETAXES with no output argument make automatic adjustments to the
% current axes position propery if parts of the axes is clipped from
% sides due to small figure size.
%
% SETAXES(AX) takes the axes with handle AX for the current axes.
%
% This first step works for common cases. For complete control over
% axes position and other features, use the advanced syntax below.
%
% FH = SETAXES(..) makes no automatic adjustments and returns a structure
% FH of 9 function handles for 2-D view and 3 function handles for 3-D view.
% A brief description of the purpose of each function is:
%
% Function Purpose of the nested function handle
% ----------------- ---------------------------------------------------
% 'FH.xoffset' To move and stretch the axes in horizontal direction
% 'FH.yoffset' To move and stretch the axes in vertical direction
% 'FH.legendmoveresize' To shrink and relocate the legend
%
%
% Function Purpose of the nested function handle
% (2D-view only)
% ----------------- ---------------------------------------------------
% 'FH.xtick2text' To replace XTickLabels by text objects
% 'FH.ytick2text' To replace YTickLabels by text objects
% 'FH.xlabelcorner' To place XLabel at the appropriate corner
% 'FH.ylabelcorner' To place YLabel at the appropriate corner
% 'FH.axesarrows' To add arrows to the axes lines
% 'FH.d1annotation' To facilitate 1D annotation objects in data space units
% 'FH.d2annotation' To facilitate 2D annotation objects in data space units
%=======================================================================
%Detail for each function and a comprehensive EXAMPLE is included in help.
%-----------------------------------------------------------------------

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
19 May 2008 Christopher Barrington-Leigh

Wow, this is a labour of love and is nearly magical for me. For months I have been struggling with the infuriating difficulty of exporting small figures with LaTeX-rendered xlabels.
The automatic mode of your code improves the situation for me. I need to use the detailed version to get it right, and that means fiddling around by hand for each plot. Being reduced to that again is of course, a great shame and a significant failure for Matlab, but at least I know how now. To Mukhtar (and the blog which inspired him) -- THANK YOU!!!

18 Jun 2008 tom mezger

cool. this is one of the best files i have ever found.

Please login to add a comment or rating.
Updates
05 Feb 2008

Corrected typos in help both in file and on file exchange summary.

05 Feb 2008

Corrected description.

06 Feb 2008

Included inspiration.

18 Sep 2008

Fixed a bug thanks to Thorsten Bartels-Rausch. The functions xtick2text and ytick2text were not working as expected in case of logarithmic (XScale,YScale) and/or reverse (XDir,YDIR).

20 Oct 2008

Dependency on a missing file removed

Tag Activity for this File
Tag Applied By Date/Time
annotation Mukhtar Ullah 22 Oct 2008 09:46:27
customization Mukhtar Ullah 22 Oct 2008 09:46:27
publication quality Mukhtar Ullah 22 Oct 2008 09:46:27
latex Mukhtar Ullah 22 Oct 2008 09:46:27
small figures Mukhtar Ullah 22 Oct 2008 09:46:27
clipped labels Mukhtar Ullah 22 Oct 2008 09:46:27
 

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