very SIMPLE question about a FIGURE
very SIMPLE question about a FIGURE
(OP)
hi all
okay, i have a simple plot saved in a .fig file
i JUST need to RETRIEVE the data of the Y axis
i m SURE it can be done, but i cant figure it out
i have even SEEN the data when editing the plot but i cant save it to workspace
help?
okay, i have a simple plot saved in a .fig file
i JUST need to RETRIEVE the data of the Y axis
i m SURE it can be done, but i cant figure it out
i have even SEEN the data when editing the plot but i cant save it to workspace
help?





RE: very SIMPLE question about a FIGURE
were are the original data? I mean, you ploted that from one Variable from workspace, right?. that variable exist?
RE: very SIMPLE question about a FIGURE
sorry: real interesting, but I can't help you..
good luck!
RE: very SIMPLE question about a FIGURE
yes, the original data was deleted, now i just have the .fig file left
i m really buggered, cuz i CAN see the data, i just need to "edit" the plot, then click on Y axis, and the data is THERE!! (check it out), but theres no option to "save it to workspace", as can be done with the "basic fitting" (mean, std, variance...)
if i have no other choice, i can RETYPE the data by hand (i insist, its there), though is just CANT believe there is no other way to retrieve it!!
i tried to edit the .fig file but its a load of cr*p
anyone help?
P.D. if anyone sorts this out, this ought to go to the HALL OF FAME, truely...
RE: very SIMPLE question about a FIGURE
its 3 am, and im listening to limp bizkit to keep my mind sharp
i think i got a "partial" solution, nuff for me today, ill try to find something better tomorrow
ok, so i just have the fig
>> open crappy.fig
>> gcf % returns the handle of the current figure
>> saveas(gcf, 'crappy', mmat) % that should create a crappy.fig and a crappy.m, ignore any warning msg
>> edit crappy.m
% scroll down and u will find something like 'YData',[2 11 7 14]);' (this is just a stupid example, i used durer magic matrix
well, at least now i only have to "cut & paste" if the number is low
if its a big number (hundreds ++) it will also create a file called crappy.mat, its a cell array
just type
>> load crappy
and it will get to ur workspace as a "mat" variable
mat{i} is the ith-dimension
well, im going to get some deserved sleep...
RE: very SIMPLE question about a FIGURE
Open myfig.gif
myfigId=gcf;
myfigChildren=get(myfigID, 'Children');
%returns all the children in an array
%now you must identify which one of these children is the line you are interested in. To do this type
get(myfigChildren(1));
get(myfigChilfren(2));
%... etc untill you see some data in the Xdata Ydata properties. Then..
%lets say that the line you want is object 2 in the figure
%so now
myline=get(myfigChildren(2));
myxdata=get(myline,'Xdata');
myydata=get(myline,'Ydata');
%and voila, Hope this helps
JR.
RE: very SIMPLE question about a FIGURE
i had been looking through the set and get functions, but hadnt quite grasped how to use em
RE: very SIMPLE question about a FIGURE
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=U...
excerpt from the above URL:
----start excerpt-----
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
slord@mathworks.com
----end excerpt-----