[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fwd: Re: Octave - is there a possibilty to access the data of a plotted
From: |
Werner Koenig |
Subject: |
Fwd: Re: Octave - is there a possibilty to access the data of a plotted curve |
Date: |
Fri, 06 Sep 2013 18:58:20 +0200 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20 |
Hello Jason, hello List
Thanks for the quick and realy good answers. Jasons answer is exact
the solution for what I wanted. I have make a little test-routine to clarify
the solved problem for all interested people.
function TestPlot_001()
clf
hold on
% because to make a simple example
% plot length is always equal
% So you can put the Data in a field
% In a more complex example, you have
% to use a structure
plot(0:0.1:6,sin(0:0.1:6))
plot(0:0.1:6,sqrt(0:0.1:6))
plot(0:0.1:6,log(0:0.1:6))
childrenOfAxes = get(gca,"children"); % This is the handle to all
line objects on the current axes
for i = 1 : length(childrenOfAxes) % access all curves
gco = childrenOfAxes(i); % this is the object
of line(i)
xdata(i,:) = get (gco, "xdata"); % get data and put it
in a field
ydata(i,:) = get (gco, "ydata");
endfor
echo = "Hit any key"
pause
% now you can do something with the data, e.g. redraw
clf
pause(2)
hold on
s = size(xdata);
for i = 1:s(1,1)
plot(xdata(i,:),ydata(i,:));
endfor
hold off
endfunction
But now I have some more questions
- can I select a curve with the mouse
- how get I the information that the curve was selected
----- is there an interrupt,
----- may I install a listener or
----- may I done some other pollings
- how get I the information, which curve and which point
of the curve is selected
So long Werner
returns please to list and address@hidden
- Fwd: Re: Octave - is there a possibilty to access the data of a plotted curve,
Werner Koenig <=