Code covered by the BSD License  

Highlights from
figtitle

5.0
5.0 | 2 ratings Rate this file 59 Downloads (last 30 days) File Size: 27.2 KB File ID: #42667 Version: 1.4
image thumbnail

figtitle

by

Chad Greene (view profile)

 

16 Jul 2013 (Updated )

Create a title for a figure with multiple subplots.

| Watch this File

File Information
Description

figtitle creates a title centered at the top of a figure. This may be used to add a title to a figure with several subplots.
Syntax:
figtitle('TitleString')
figtitle('TitleString','TextProperty','TextValue')
h = figtitle(...)

Description:
figtitle('TitleString') centers a title at the top of a figure and sets the figure name to 'TitleString'.

figtitle('TitleString','TextProperty',TextValue) formats the title with property name value pairs (e.g., 'FontSize',20)

h = figtitle(...) returns a handle h of the newly-created title.

Examples:

figtitle('My Title')

figtitle('My Title','fontweight','bold')

figtitle('My Title,'fontsize',18,'fontangle','oblique')

h = figtitle('My Title');
set(h,'edgecolor','magenta');

In many cases a figure title may overlap a subplot title. To reduce ambiguity, try pairing this function with the ntitle function, which is available on the Mathworks File Exchange here: http://www.mathworks.com/matlabcentral/fileexchange/42114-ntitle. The image for this FEX upload was created using the figtitle and ntitle example given in figtitle.m.

Acknowledgements

Mtit: A Pedestrian Major Title Creator and Ntitle inspired this file.

This file inspired Label.

Required Products MATLAB
MATLAB release MATLAB 8.0 (R2012b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (7)
20 Apr 2015 Joey

Joey (view profile)

This plus ntitle is a nice combination.

03 Apr 2015 Henrik

Henrik (view profile)

Small, simple, and just works.
Great little tool

27 Aug 2014 Richard

A similar program is suptitle.m, at:

http://www.mathworks.com/matlabcentral/fileexchange/3091-test-and-measurement-seminar-demos/content/Throttle%20for%20ML%20Central/utilities/suptitle.m

Comment only
18 Aug 2014 Chad Greene

Chad Greene (view profile)

That's an excellent suggestion, Thomas. I've included your suggested change in the latest update.

Comment only
11 Oct 2013 Thomas

Thomas (view profile)

Nice tool. May I suggest that you change the command "axes(hca)" to "set(gcf,'CurrentAxes',hca)", on line 116? This will avoid making the figure visible for those who plot to invisible figures. (Primarily done to speed up figure creation when printing to file.)

Comment only
19 Aug 2013 Chad Greene

Chad Greene (view profile)

Thanks for bringing submission 3218 to my attention, Felipe--I had not seen it before. Mtit and figtitle are synonymous, but one small difference is that figtitle is designed for the novice user who may be scared off by a complex title like "mtit: a pedestrian major title creator".

I created figtitle after my search of File Exchange came up empty, and in retrospect it is possible that I found mtit in my search but it was not clear what mtit does or how to use it. The figtitle function has an intuitive name that can be comfortably said aloud in a workplace setting, and on this page I have attempted to provide straightforward examples that should look familiar to anyone who has used the 'title' command. There is also a picture on this page to immediately help the FEX user identify what figtitle does.

For anyone deciding whether to adopt usage of mtit or figtitle, my guess is that mtit may be slightly more powerful and figtitle may be slightly more intuitive.

Comment only
29 Jul 2013 Felipe

Felipe (view profile)

Could you please compare figtitle to "mtit", FX submission #3218? Thanks.

Comment only
Updates
18 Jul 2013 1.1

Updated examples. Also no longer returns a title handle unless the user requests it.

19 Aug 2013 1.2

Acknowledged submission 3218.

18 Aug 2014 1.3

Added example file. Changes to figtitle: now supports invisible figures and now changes the name of figures to input title string.

19 Aug 2014 1.4

Vectorized a loop.

Contact us