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: .fig not saved properly using "saveas"
Replies: 4   Last Post: Apr 10, 2013 1:49 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Curious

Posts: 1,966
Registered: 12/6/04
Re: .fig not saved properly using "saveas"
Posted: Apr 5, 2013 5:25 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Nathan " <nathan.hamilton@uah.edu> wrote in message <kjnc8k$48b$1@newscl01ah.mathworks.com>...
> In the following section of code, I am attempting to save a plot (a figure within a custom GUI) as a ".fig" file. The file seems to save properly, but when I open the ".fig" file in MATLAB, it only appears as graphic. That is, the image is pixelated and the plot's data is not accessible using MATLAB's figure tools. For example, the Data Cursor selects pixel values rather than data points along the curve.

I may be wrong, but I believe that is the normal and intended behavior of the SAVEAS command.
Try HGSAVE instead, that may be what you are looking for.

doc hgsave
doc hgload

>
> The applicable code section:
>
> saveFolder = uigetdir(savePath);
> F=getframe(handles.axes1); %select axes in GUI
> figure(); %new figure
> fileTitle = saveFileName; %filename
> image(F.cdata); %show selected axes in new figure
> saveas(gcf, fullfile(saveFolder,fileTitle),'fig'); %save figure
> close(gcf); %and close it




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.