Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: save figures without displaying
Replies: 18   Last Post: Sep 2, 2014 1:14 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Tor Inge Birkenes

Posts: 2
Registered: 12/13/12
Re: save figures without displaying
Posted: Dec 13, 2012 7:21 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

> Any ideas how to save invisible figures, but have them open as visible?

I have made a function that changes the visible parameter on a saved .fig file, thus make a fig file saved invisible open as visible. It looks like this:

function makevisible(file)
f=load(file,'-mat');
n=fieldnames(f);
f.(n{1}).properties.Visible='on';
save(file,'-struct','f')
end

Just save this to makevisible.m and call makevisible('figure.fig'). Note that the .fig extension is necessary.

Sources:
http://undocumentedmatlab.com/blog/fig-files-format/ (to understand enough of the fig file format)
http://blogs.mathworks.com/pick/2008/08/20/advanced-matlab-dynamic-field-names/ (to make the code more efficient)



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.