Raul - the spectopo function seems to make use of calls to plot (or at least, the version at http://sccn.ucsd.edu/eeglab/allfunctions/spectopo.html seemed to) in order to display data on the axes. If that is the case, then you may be able to do something like the following in order to get the x and y data that you wish. Suppose we are plotting the sine and cosine curves on an axes object
t=-2*pi:0.0001:2*pi;
u=sin(t);
v=cos(t);
hold(handles.axes1,'on');
plot(handles.axes1,t,u,'b');
plot(handles.axes1,t,v,'g');
In order to get the x and y data from each call to plot, we need to access the 'children' of the axes
hChildren = get(handles.axes1,'Children');
In this example, because we plotted two curves on the axes, hChildren is a 2x1 vector of handles to the plot graphics objects.
To get the x and y data from the first handle (which may not correspond to the first plot), we do
xData1 = get(hChildren(1),'XData');
yData1 = get(hChildren(1),'YData');
Note that this will be all of the data that has been plotted, even after you have set the limits on the axes.
If you're okay with storing all of this data, then just save it to the handles structure as
handles.xdata1 = xData1;
handles.ydata1 = yData1;
guidata(hObject,handles);
Now you can access the x and y data as fields from the handles structure within any other callback.
Best Answer