File Exchange

image thumbnail

expandAxes(hndls,ro​tEnable)

version 1.7.0.1 (6.59 KB) by

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

5 Downloads

Updated

View License

FUNCTION EXPANDAXES(HNDLS)
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.)
SYNTAX:
expandAxes
Sets the current axes to expand on buttondown.

expandAxes(hndls)
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.

MOTIVATION:
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.

Comments and Ratings (14)

KAE

KAE (view profile)

Useful when you have a lot of plots to compare

Matteo Niccoli

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(hndlSet.ax, 'Parent')
hndlSet.oldfig = gcf;
set(hndlSet.objectsOfInt,'buttondownfcn',{@expandIt,hndlSet,rotEnable});
end

Shawn Heide

Jurgen

Jurgen (view profile)

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:

set(new_ax,'units','normalized',...
'position',[0.1 0.1 0.8 0.8],...
'xtickmode','auto','ytickmode','auto');

Cheers,
Brett

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.
Cheers,
Brett

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)? ...

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.

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.

Sergey Karpov

Thank u!

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.

Bob Rooney

Perfect! Thanks alot.

Olivier B.

Simple but very usefull when managing lot of subplots !

Updates

1.7.0.1

Updated license

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.)

1.7

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

1.5

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

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|.)

1.3

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

1.2

updated license text file to The MathWorks, Inc.

1.1

added copyright

MATLAB Release
MATLAB 7.5 (R2007b)

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

» Watch video