View License

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

» Watch video

Highlights from

3.5 | 2 ratings Rate this file 4 Downloads (last 30 days) File Size: 1.59 KB File ID: #25140 Version: 1.0




Shrink or expand the spacing between subplots in a figure.

| Watch this File

File Information

The spacing between subplots takes up a lot of space, which I would like to use to show my results. I wrote subplotSpacing.m to shrink the spacing between subplots, and thus increase the relative area occupied by the figures. subplotSpacing.m can also be used expand the spacing between subplots. It just depends on the value of the 'space' input.

MATLAB release MATLAB 7.7 (R2008b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
17 Apr 2012 Karl

Karl (view profile)

This doesn't work if you combine subplots - line 18 in the code catches it as an error. For example:
subplot(2,2,[3 4]);plot(x3,y3);
MATLAB returns:
Error using subplotSpacing (line 18)
dimensions of subplot do not match number of elements of h

30 Jun 2010 Michelle Armenta

I tried using it for a several figures with different number of rows an columns and it keeps making them even smaller and dragging them to the left bottom corner. I don't know if it's my matlab version (v. 7, yr 2004) or sth else.

Comment only
19 Oct 2009 James Edwards

Thanks for this, very nice and easy to use.

I have only a 1 row and 2 column subplot, so I got an error in 'pull rows together section'. I just put "if numrows > 1" around it and it worked fine.

Contact us