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: Extracting data from a figure file
Replies: 1   Last Post: Mar 4, 2013 12:55 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
dpb

Posts: 8,153
Registered: 6/7/07
Re: Extracting data from a figure file
Posted: Mar 4, 2013 12:55 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 3/4/2013 6:02 AM, Ansh wrote:
> does anyone know how to get x and y data from a figure that's been
> plotted using two vectors (in MATLAB)? I need to extract the raw data
> (which has been lost) that was used to plot a figure (which I do have
> saved)
>
> I feel like I have to use handles or something, but im not sure how...


Yes, the data are contained in the [X|Y|Z]Data properties of the line(s)
that are children of the axis.

Presuming saved as a .fig file,

open('yourfilename.fig');
x=get(get(gca,'children'),'xdata');
y=get(get(gca,'children'),'ydata');

--




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.