Thread Subject:
import the data in figure

Subject: import the data in figure

From: Il Yoon

Date: 25 Sep, 2008 00:05:04

Message: 1 of 5

Hello,

I plotted a figure file (*.fig) from the matrix data file using Matlab. But, I deleted the matrix file.
So, I want to import the data from figure. Then, how can I import the data in figure?

Thanks.

Yoon

Subject: import the data in figure

From: Matt Fig

Date: 25 Sep, 2008 01:39:02

Message: 2 of 5

For example:


x = 1:10;
y = x.^2;
plot(x,y)
clear x y % x and y are lost.
ch = get(gca,'ch');
x = get(ch,'xd')
y = get(ch,'yd')

Subject: import the data in figure

From: Il Yoon

Date: 25 Sep, 2008 16:41:02

Message: 3 of 5

"Matt Fig" <spamanon@yahoo.com> wrote in message <gbeq3m$fjl$1@fred.mathworks.com>...
> For example:
>
>
> x = 1:10;
> y = x.^2;
> plot(x,y)
> clear x y % x and y are lost.
> ch = get(gca,'ch');
> x = get(ch,'xd')
> y = get(ch,'yd')

Thanks a lot for your help.

Yoon

Subject: import the data in figure

From: grega

Date: 7 Sep, 2012 10:08:07

Message: 4 of 5

It works nice.

BUT, what if you zoom in a fig and then want to get [X,Y] pairs from zoomed fig/axes?

Subject: import the data in figure

From: Steven_Lord

Date: 7 Sep, 2012 13:27:18

Message: 5 of 5



"grega " <smrexx@yahoo.com> wrote in message
news:k2ch27$prg$1@newscl01ah.mathworks.com...
> It works nice.
>
> BUT, what if you zoom in a fig and then want to get [X,Y] pairs from
> zoomed fig/axes?

Zooming into a figure or axes doesn't change the coordinates of the points
in the data space. It does change them in the pixel space, but that's a
separate question. Are the data space coordinates what you're after, the
pixel space coordinates, or something else?

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us