plmntt
plmntt

Reputation: 11

Save axes plot as '.fig' in a GUI

I have a GUI in MATLAB with two axes with handles respectively:

handles.axis1
handles.axis2

I want to save the contents of one of the two axes (i.e. handles.axis2) in an external MATLAB Figure File Format (.fig).

I want a .fig file so export_fig is not the solution of my problem.

Any suggestion?

Upvotes: 0

Views: 3382

Answers (1)

p8me
p8me

Reputation: 1860

Almost just quoting Jan's answer from here:

fh = figure;
copyobj(handles.axis2, fh);
saveas(fh, 'figure_file','fig');
close(fh);

See also: savefig, hgsave

Upvotes: 1

Related Questions