Path: news.mathworks.com!newsfeed-00.mathworks.com!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!newspeer1.se.telia.net!se.telia.net!masternews.telia.net.!newsb.telia.net.POSTED!not-for-mail
From: PB <pbodin@_REMOVE_THiS_kth.se>
Subject: Re: extracting data from .fig in 2007a - did the proceedure change?
Newsgroups: comp.soft-sys.matlab
References: <ffl47g$q5v$1@fred.mathworks.com>
User-Agent: pan 0.120 (Plate of Shrimp)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Lines: 37
Message-ID: <6WoTi.12020$ZA.7930@newsb.telia.net>
Date: Tue, 23 Oct 2007 16:02:10 GMT
NNTP-Posting-Host: 217.208.84.46
X-Complaints-To: abuse@telia.com
X-Trace: newsb.telia.net 1193155330 217.208.84.46 (Tue, 23 Oct 2007 18:02:10 CEST)
NNTP-Posting-Date: Tue, 23 Oct 2007 18:02:10 CEST
Organization: Telia Internet
Xref: news.mathworks.com comp.soft-sys.matlab:434263



Den Tue, 23 Oct 2007 15:33:04 +0000 skrev Chris :

> I'd like to extract the original data from several 
> scatterplot .fig files.  However, using load('filename','-
> mat') does not produce xdata and ydata files and the file 
> available here "getfigdata.m" also returns an error saying 
> it can't find "lh".  
> 
> Does anyone know where the data is actually stored in 
> a .fig file under 2007a?
> 
> For instance, www.gaiteri.net/intrinsic_stress.fig
> is one I just need to extract this very simple information 
> from.  Thanks!

I get the following error trying to download your fig:

The page cannot be found...

Anyway, this might work:

%create figure

fplot(@humps,[0,1]);
saveas(gcf,'test','fig');
close(gcf);	% close fig

% open the figure again
fighandle=openfig('test.fig');
ax=findall(fighandle,'Type','line');
x=get(ax,'Xdata')
y=get(ax,'YData')


HTH

PB