Path: news.mathworks.com!not-for-mail
From: "us " <us@neurol.unizh.ch>
Newsgroups: comp.soft-sys.matlab
Subject: Re: extract data from figure
Date: Thu, 16 Aug 2007 13:19:53 +0000 (UTC)
Organization: Universit&#228;tsSpital Z&#252;rich
Lines: 25
Message-ID: <fa1itp$3qk$1@fred.mathworks.com>
References: <f9h1p6$2si$1@fred.mathworks.com><f9h330$i6h$1@fred.mathworks.com> <1186832912.881331.263840@q3g2000prf.googlegroups.com> <fa1h0p$7ip$1@fred.mathworks.com>
Reply-To: "us " <us@neurol.unizh.ch>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1187270393 3924 172.30.248.38 (16 Aug 2007 13:19:53 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 16 Aug 2007 13:19:53 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 11
Xref: news.mathworks.com comp.soft-sys.matlab:424144


Mohammed:
<SNIP data from figure file evergreen...

one of the solutions

% the data
     x=1:10;
     y=rand(size(x));
     fnam='afig.fig';
% ...on display
     fh=figure;
     line(x,y);
% ...and saved
     saveas(gcf,fnam);
     delete(fh);
% the engine
     open(fnam);
     lh=findall(gca,'type','line');
     xx=get(lh,'xdata');
     yy=get(lh,'ydata');
% the result
     [isequal(x,xx)
      isequal(y,yy)]

us