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!
Subject: extracting data from .fig in 2007a - did the proceedure change?
"Chris " <cag44@removethispitt.edu> wrote in message
<ffl47g$q5v$1@fred.mathworks.com>...
> 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!
Subject: extracting data from .fig in 2007a - did the proceedure change?
> 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
Subject: extracting data from .fig in 2007a - did the proceedure change?
> 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!
load the file, then start digging through the resulting structure:
"Chris " <cag44@removethispitt.edu> wrote in message
<ffl47g$q5v$1@fred.mathworks.com>...
> 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!
This works:
s=hgload('inlet.fig')
h = findobj(s,'Type','line')
y=get(h,'ydata');
x=get(h,'xdata');
Subject: extracting data from .fig in 2007a - did the proceedure change?
I tried your exact code on one of my figures and findobj
always returns empty.
"Dan Haeg" <haegd@msoe.edu> wrote in message
<fflasp$skn$1@fred.mathworks.com>...
> "Chris " <cag44@removethispitt.edu> wrote in message
> <ffl47g$q5v$1@fred.mathworks.com>...
> > 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!
>
> This works:
>
> s=hgload('inlet.fig')
> h = findobj(s,'Type','line')
> y=get(h,'ydata');
> x=get(h,'xdata');
>
>
Subject: extracting data from .fig in 2007a - did the proceedure change?
I tried your exact code on one of my figures and findobj
always returns empty.
"Dan Haeg" <haegd@msoe.edu> wrote in message
<fflasp$skn$1@fred.mathworks.com>...
> "Chris " <cag44@removethispitt.edu> wrote in message
> <ffl47g$q5v$1@fred.mathworks.com>...
> > 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!
>
> This works:
>
> s=hgload('inlet.fig')
> h = findobj(s,'Type','line')
> y=get(h,'ydata');
> x=get(h,'xdata');
>
>
Subject: extracting data from .fig in 2007a - did the proceedure change?
"Chris " <cag44@removethispitt.edu> wrote in message
<fflt8n$cpe$1@fred.mathworks.com>...
> Hi Dan - thanks for the information.
>
> I tried your exact code on one of my figures and findobj
> always returns empty.
>
> "Dan Haeg" <haegd@msoe.edu> wrote in message
> <fflasp$skn$1@fred.mathworks.com>...
> > "Chris " <cag44@removethispitt.edu> wrote in message
> > <ffl47g$q5v$1@fred.mathworks.com>...
> > > 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!
> >
> > This works:
> >
> > s=hgload('inlet.fig')
> > h = findobj(s,'Type','line')
> > y=get(h,'ydata');
> > x=get(h,'xdata');
> >
> >
>
If it is not too late this works for your scatter plot:
s=hgload('stress_intrinsic.fig')
h = findobj(s,'Type','hggroup')
y=get(h,'ydata');
x=get(h,'xdata');
Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central. Read the complete Disclaimer prior to use.