View License

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

» Watch video

Highlights from

4.9 | 10 ratings Rate this file 6 Downloads (last 30 days) File Size: 6.59 KB File ID: #18291 Version:
image thumbnail



Brett Shoelson (view profile)


10 Jan 2008 (Updated )

Click any axes to expand it in a separate figure. Right-click expanded axes to export contents!

| Watch this File

File Information

Allows you to click on any axes (or child thereof) in the list of input handles. Left-clicking will popup a new window in the position of the original, filled with the single axes and all its children. Clicking on that figure closes the popup window. (Right-clicking restores non-expanding status to the axis.)
     Sets the current axes to expand on buttondown.
     Sets all axes in the input list of handles to expand on buttondown.
NOTE: This function modifies the BUTTONDOWNFCN of axes in the input list, and their children. However, it will not modify any object whose buttondownfcn is nonempty.
In real estate, there's a saying: "Location, location, location." In computer graphics, the saying is (or ought to be): "Real estate, real estate, real estate." This function allows you to show a lot more plots, graphics, etc. in a single figure without sacrificing the ability to see larger versions of same.


This file inspired Image Toolbar, Segment Tool: An Interactive Gui For Segmenting Images, and Explore Rgb.

MATLAB release MATLAB 7.5 (R2007b)
MATLAB Search Path
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (14)
06 Jan 2017 KAE

KAE (view profile)

Useful when you have a lot of plots to compare

29 Oct 2014 Matteo Niccoli

14 Aug 2014 Shawn Heide

This function works perfectly and was really easy to implement. I'm not sure if anyone else has this problem, but I save figures with expandable axes and I've noticed that the oldfig property doesn't always match what the new figure handle is. I added the following code to the nested function expandIt and everything works great. Thanks Brett!

if ~ishandle(hndlSet.oldfig) | hndlSet.oldfig ~= get(, 'Parent')
hndlSet.oldfig = gcf;

Comment only
14 Aug 2014 Shawn Heide

02 Jan 2013 Jurgen

Jurgen (view profile)

11 Apr 2012 Brett Shoelson

Brett Shoelson (view profile)

NOTE: Maryam also asked me if she could modify the tick marks on the pop-up axis. That, too, is easily done. Just make whatever changes you want to customize new_ax at the appropriate place in the code. For instance:

'position',[0.1 0.1 0.8 0.8],...


Comment only
10 Apr 2012 Brett Shoelson

Brett Shoelson (view profile)

Maryam, it's very easy to make expandAxes do what you want. Just modify the single line in subfunction "exapandIt" where I create the figure. Change 'menubar','none' to 'menubar','figure'. Let me know if that works for you.

Comment only
10 Apr 2012 Maryam Vareth

This function is very useful. Thank you!! I was just wondering whether there is an easy way to also add an option to have a full functioning popup plots (meaning, to click into one of the interesting thumbnail images and be able to look at the values, intensities, (things that we can do in regular plot window)? ...

18 Feb 2011 Brett Shoelson

Brett Shoelson (view profile)

Thanks, Adi. For users of older versions of MATLAB, please note the single quotes around 'isempty' in Adi's comments.

Comment only
14 Feb 2011 Adi

Adi (view profile)

Great gizmo.
Justa little remark. For those still using old Matlab 7.0 R14 I found that " @isempty " needs to be changes to " 'isempty' " in order to work. Good job, thanks.

27 May 2008 Sergey Karpov

Thank u!

15 Jan 2008 John D'Errico

A creative way to turn a whole mess of plots into thumbnail images. Then you can click on only the ones you want to see to bring them up.

11 Jan 2008 Bob Rooney

Perfect! Thanks alot.

11 Jan 2008 Olivier B.

Simple but very usefull when managing lot of subplots !

04 May 2010 1.1

added copyright

21 Jun 2010 1.2

updated license text file to The MathWorks, Inc.

21 Jun 2010 1.3

Updated M file and license text file copyright to The MathWorks, Inc.

28 Mar 2013 1.4

Now supports automatic export of images by right-clicking an expanded axes! (If the axes contains a non-image, a snapshot of the axes is exported, using |getframe|.)

28 Mar 2013 1.5

Right click on any expanded axes to automatically save contents to base workspace!

08 Jan 2015 1.7

Fixed a couple very minor bugs. Ensured R14b readiness. General cleanup.

02 Jun 2015 1.7

Bug fix: should work in old and new versions of MATLAB. (If you have a version of expandAxes that is working for you, no need to change. But if you're encountering errors, this should address them.)

01 Sep 2016

Updated license

Contact us