File Exchange

image thumbnail

Import Fig File to Axes

version (1.45 KB) by Stuart McGarrity
Import fig file to axes


Updated 01 Sep 2016

View License

% IMPORTFIG(Figfilename,Axes) opens a fig file and places the
% contents into another axes such as on a subplot.
% Example
% h=subplot(3,2,1);
% importfig('plot1.fig',h);
Useful if you have lots as fig files and you want to view/tile them together.

Cite As

Stuart McGarrity (2020). Import Fig File to Axes (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (13)

Hope I'm not stepping on toes, linking to my script, but for those that want subplot support, I made something similar that montages currently open figures, and I just added a version today that will read figure files (though it's the same as last, but opens them invisible,reads,then closes them). It will replot subplots (just grabs all axes from each figure and excludes colorbars).

I didn't look at this one until now, so it may be inferior, but I believe it does what it should. Hope some find it helpful.

Dom Daniels

Useful in itself, but would be perfect if it could import subplot based figs to a new axes (ie redesign the axes)

John Doe

Does exactly what it was supposed to!

enver yaðcý

Thanks, that is what I needed


Exactly what I needed! Works perfectly

Les King

Worked perfectly for me. Saved me a tonne of time.

rand walk

good, but some warning happens

Sergei K

Hmm... After restarting Matlab next day this function worked as intended. I'm not sure what caused that message anymore (Invalid uitoolbar property: 'Position'.)

Sergei K

using example or any variations of it
% h=subplot(3,2,1);
% importfig('plot1.fig',h);
in Matlab r14(SP3) gives error:
??? Error using ==> set
Invalid uitoolbar property: 'Position'.

cc ib

very useful

Dan Vaughan

Nice script. Might want to enable copying of the legend from the old plot to the subplot

Rafa Abella

It doesn't work well , if you want in a subplot a figure with subplot

Jhonny Pepperonny

Very usefull!!!


Updated license

Copyright work.

MATLAB Release Compatibility
Created with R13
Compatible with any release
Platform Compatibility
Windows macOS Linux