3.69231

3.7 | 13 ratings Rate this file 420 downloads (last 30 days) File Size: 2.04 KB File ID: #7772

suplabel

by Ben Barrowes

 

03 Jun 2005 (Updated 03 Sep 2009)

Code covered by BSD License  

Places text as a title, xlabel, or ylabel on a group of subplots.

Editor's Notes:

This file was a File Exchange Pick of the Week

Download Now | Watch this File

File Information
Description

PLaces text as a title, xlabel, or ylabel on a group of subplots. Returns a handle to the label and a handle to the axis.

[ax,h]=suplabel(text,whichLabel,supAxes)

returns handles to both the axis and the label.

ax=suplabel(text,whichLabel,supAxes)

returns a handle to the axis only. suplabel(text) with one input argument assumes whichLabel='x'

whichLabel is any of 'x', 'y', or 't', specifying whether the text is to be the xlable, ylabel, or title respectively.
 
supAxes is an optional argument specifying the Position of the "super" axes surrounding the subplots. supAxes defaults to [.075 .075 .85 .85] specify supAxes if labels get chopped or overlay subplots

EXAMPLE:
   subplot(2,2,1);ylabel('ylabel1');title('title1')
   subplot(2,2,2);ylabel('ylabel2');title('title2')
   subplot(2,2,3);ylabel('ylabel3');xlabel('xlabel3')
   subplot(2,2,4);ylabel('ylabel4');xlabel('xlabel4')
   [ax,h1]=suplabel('super X label');
   [ax,h2]=suplabel('super Y label','y');
   [ax,h3]=suplabel('super Title' ,'t');
   set(h3,'FontSize',30)
 
  SEE ALSO: text, title, xlabel, ylabel, zlabel, subplot,
            suptitle (Matlab Central)

MATLAB release MATLAB 7 (R14)
Zip File Content  
Other Files license.txt,
suplabel.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (17)
06 Jun 2005 urs (us) schwarz

1) nice little helper; 2) it would be more convenient if supaxes would default to the outer boundaries of all axes on the canvas if it is not defined by the user (see mtit on the FEX); 3) supaxes' default values do not correspond to those shown in the help section

07 Aug 2006 jon erickson

Thank you--just what I was looking for! very easy to use. Just to follow up on comment 3) above, the default values are [0.08 0.08 0.84 0.84], not a major change.

19 Aug 2007 him s

nopes..not working

11 Oct 2007 Pablo Velarde

Excellent!

31 Mar 2008 pippo baudo  
19 Apr 2008 Chris Addison

Exactly what I was looking for! Thanks for this.

23 Apr 2008 Tom Van Grootel

Axes below the "Ghost" axes made by SUPLABEL are not editable (zoom, scale, rotate). Hint to improve this: 'HitTest' set to 'Off', but this still did not solve it.

16 Jun 2008 Pablo Pablo

I can not rotate an image when I use this function.

07 Aug 2008 Pierrick Mialle  
12 Aug 2008 Jake Munster

Useful tool, but as Tom Van Grotel said, I can't zoom in on the subplots! Setting 'HitTest' to 'Off' did not work =(

24 Feb 2009 Henry

Good tool, but like all other comments, I cannot zoom/rotate the image afterwards.

07 Aug 2009 omzaz  
07 Aug 2009 omzaz

potentially useful for me, but not until zoom/rotate issue is fixed.

03 Sep 2009 Scott Otterson

A quick solution to a common problem. Zooming would be nice -- I haven't checked the underpinnings, but if anyone is interested in taking a look

http://www.mathworks.com/matlabcentral/fileexchange/19314

decorates plots with extra labels and survives the zoom button

23 Sep 2009 Joe McGlinchy

GREAT! works perfect thanks

09 Nov 2009 sophie neve

I have aproblem with it : if I only do 4 subplot out of 6, for example 1,2,4,5 and not 3 and 6, the title is not centered any more.... sad :(

09 Nov 2009 sophie neve

I have seen another think that is sad : no greek letter is allowed
Example :
suplabel('log_{10} (Re \epsilon *)','y');

does not write the epsilon, right?

Please login to add a comment or rating.
Updates
07 Jun 2005

Updated default values.

23 Jun 2005

Default behavior now detects existing axes.

03 Sep 2009

added capability for right side y-label

Tag Activity for this File
Tag Applied By Date/Time
annotation Ben Barrowes 22 Oct 2008 07:49:49
customization Ben Barrowes 22 Oct 2008 07:49:49
super Ben Barrowes 22 Oct 2008 07:49:49
label Ben Barrowes 22 Oct 2008 07:49:49
title Ben Barrowes 22 Oct 2008 07:49:49
group Ben Barrowes 22 Oct 2008 07:49:49
ylabel Ben Barrowes 22 Oct 2008 07:49:49
subplot Ben Barrowes 22 Oct 2008 07:49:49
xlabel Ben Barrowes 22 Oct 2008 07:49:49
super Greg 23 Nov 2009 03:58:04
 

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