Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: .fig not saved properly using "saveas"
Date: Tue, 9 Apr 2013 18:05:07 +0000 (UTC)
Organization: The MathWorks Inc
Lines: 24
Message-ID: <kk1l8j$d4o$1@newscl01ah.mathworks.com>
References: <kjnc8k$48b$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-00-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1365530707 13464 172.30.248.45 (9 Apr 2013 18:05:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 9 Apr 2013 18:05:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1034498
Xref: news.mathworks.com comp.soft-sys.matlab:793090

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

Nathan, 
When you are calling saveas above, the figure you're saving only contains the image that you retrieved by calling getframe. 

I think what you want to do is call saveas with the original figure (whatever figure handles.axes1 belongs to). 

If you want to save JUST the axes that is referenced by handles.axes1, you'll need to copy that axes to a new figure and then save that figure. 
  newfig = figure; 
  copyobj(handles.axes1, newfig);
  saveas(newfig,  ....)

You may need to tweak the code to get the size/layout you want, but hopefully this will be of some help.