Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

? Manipulate f.fig

2 views
Skip to first unread message

Cheng Cosine

unread,
Jan 21, 2002, 1:22:21 PM1/21/02
to
Hi:

After plotting the figure, one may save it as f.fig for later use. My
questios are as following:

1. To restrive the plot of F.fig, I need to run MatLab and then manually
open it by clicking it in

MatLab for PCWin. Is there any way that I can see the figure by
clicking the F.fig file in MS Win's

EXPLORER.EXE? Just like I do it for opening the *.m file?

2. In the saved F.fig, I use plot(x,y) but now I would like to have it to
show me as loglog(x,y).

How can I do that in the case that all I have is the F.fig without read
the original x and y data?

3. Suppose I have F001.fig, F002.fig, ...., F100.fig. In each file, I saved
the plot(x,y001), plot(x, y002),

...., plot(x,y100). Now, sometime later, I would like to have
plot(x(3)*ones(1,100), Y). Here the

objective Y is the array containing the data for [y001(3), y002(3), ....,
y100(3)]. How can I do this

in the case that all I have are those F*.fig files?

Thanks,
by Cheng Cosine
Jan/21/2k2 UT

Steven Lord

unread,
Jan 21, 2002, 12:40:26 PM1/21/02
to

"Cheng Cosine" <aco...@ms13.url.com.tw> wrote in message
news:8gY28.847$Z25....@news.uswest.net...

> Hi:
>
> After plotting the figure, one may save it as f.fig for later use. My
> questios are as following:
>
> 1. To restrive the plot of F.fig, I need to run MatLab and then manually
> open it by clicking it in
>
> MatLab for PCWin. Is there any way that I can see the figure by
> clicking the F.fig file in MS Win's
>
> EXPLORER.EXE? Just like I do it for opening the *.m file?

Hi Cheng,

I don't _believe_ so -- the reason the .m file opens is that the extension
is associated with the MEDITOR, which recognizes the format of the m-file.
I don't know if Explorer will recognize the .fig format.

> 2. In the saved F.fig, I use plot(x,y) but now I would like to have it to
> show me as loglog(x,y).
>
> How can I do that in the case that all I have is the F.fig without
read
> the original x and y data?

You can use handle graphics to retrieve the X and Y data from the lines in
the axis. Use the FINDOBJ function to find objects of Type Line and GET its
XData and YData.

> 3. Suppose I have F001.fig, F002.fig, ...., F100.fig. In each file, I
saved
> the plot(x,y001), plot(x, y002),
>
> ...., plot(x,y100). Now, sometime later, I would like to have
> plot(x(3)*ones(1,100), Y). Here the
>
> objective Y is the array containing the data for [y001(3), y002(3),
....,
> y100(3)]. How can I do this
>
> in the case that all I have are those F*.fig files?

See answer 2 on retrieving the X and Y data.

--
Steve Lord
sl...@mathworks.com


Cheng Cosine

unread,
Jan 22, 2002, 1:33:46 AM1/22/02
to

"Steven Lord" <sl...@mathworks.com> 撰寫於郵件
news:a2hjqa$2ta$1...@news.mathworks.com...

>
> "Cheng Cosine" <aco...@ms13.url.com.tw> wrote in message
> news:8gY28.847$Z25....@news.uswest.net...
>> ...

> > 2. In the saved F.fig, I use plot(x,y) but now I would like to have it
to
> > show me as loglog(x,y).
> >
> > How can I do that in the case that all I have is the F.fig without
> read
> > the original x and y data?
>
> You can use handle graphics to retrieve the X and Y data from the lines in
> the axis. Use the FINDOBJ function to find objects of Type Line and GET
its
> XData and YData.
> ....

Would you give an example?

Tom Davis

unread,
Jan 22, 2002, 2:48:23 AM1/22/02
to
Steven Lord wrote:
>
> "Cheng Cosine" <aco...@ms13.url.com.tw> wrote in message
> news:8gY28.847$Z25....@news.uswest.net...
> > Hi:
> >
> > After plotting the figure, one may save it as f.fig for later use. My
> > questios are as following:
> >
> > 1. To restrive the plot of F.fig, I need to run MatLab and then manually
> > open it by clicking it in
> >
> > MatLab for PCWin. Is there any way that I can see the figure by
> > clicking the F.fig file in MS Win's
> >
> > EXPLORER.EXE? Just like I do it for opening the *.m file?
>
> Hi Cheng,
>
> I don't _believe_ so -- the reason the .m file opens is that the extension
> is associated with the MEDITOR, which recognizes the format of the m-file.
> I don't know if Explorer will recognize the .fig format.

You can associate fig files with matlab, but a new instance of matlab
will be invoked each time you open a figure.

Steven Lord

unread,
Jan 22, 2002, 1:03:36 PM1/22/02
to

"Cheng Cosine" <aco...@ms13.url.com.tw> wrote in message
news:f_638.300$f85.1...@news.uswest.net...

Hi Cheng,

Here's a simple example:

plot(1:10,10:-1:1)
saveas(gcf,'MyTestFig.fig','fig')
close(gcf)
% The above generates the figure, saves it, and closes it
% This is just for setup of the example
% In an actual application, these may have been done a long time ago
% and the data from the first command may have been lost

openfig('MyTestFig.fig');
HandlesOfLines=findobj(gcf,'type','line');
% This reopens the figure and finds the Line object inside it

XData = get(HandlesOfLines,'Xdata')
YData = get(HandlesOfLines,'Ydata')
% This retrieves the X and Y data, which are:

XData =
1 2 3 4 5 6 7 8 9 10
YData =
10 9 8 7 6 5 4 3 2 1

As you can see, these are the inputs we passed to the PLOT command.

You may have some issues with finding the right line from which to retrieve
the X and Y data if you have multiple lines in the figure ... but hopefully
they have some other distinguishing characteristic that you can use with the
FINDOBJ command.

--
Steve Lord
sl...@mathworks.com


Cheng Cosine

unread,
Jan 22, 2002, 8:17:17 PM1/22/02
to

"Tom Davis" <tda...@eng.usf.edu> ????? news:3C4D1947...@eng.usf.edu...

> Steven Lord wrote:
> >
> > "Cheng Cosine" <aco...@ms13.url.com.tw> wrote in message
> > news:8gY28.847$Z25....@news.uswest.net...
> > > ....

> > > After plotting the figure, one may save it as f.fig for later use.
My
> > > questios are as following:
> > >
> > > 1. To restrive the plot of F.fig, I need to run MatLab and then
manually
> > > open it by clicking it in
> > >
> > > MatLab for PCWin. Is there any way that I can see the figure by
> > > clicking the F.fig file in MS Win's
> > >
> > > EXPLORER.EXE? Just like I do it for opening the *.m file?
> >
> > Hi Cheng,
> >
> > I don't _believe_ so -- the reason the .m file opens is that the
extension
> > is associated with the MEDITOR, which recognizes the format of the
m-file.
> > I don't know if Explorer will recognize the .fig format.
>
> You can associate fig files with matlab, but a new instance of matlab
> will be invoked each time you open a figure.

I already tried to associated *.fig to MatLab, but only MatLab pop out. No
figure will be displayed.

by Cheng Cosine
Jan/22/2k2 UT

0 new messages