Multiple datapoint selection on graph in GUI

Hello, I have what appears to be the same problem as described here http://www.mathworks.fr/matlabcentral/newsreader/view_thread/258675
where I am trying to use the selectdata.m function to select points on a graph and return the coordinates to display in the GUI. The figure of interest is a plot within a uipanel on which the graph is generated as follows:
handles.axTscores.p = subplot(1,1,1,'Parent',handles.uipanelTscores);
plot(x,y,'o');
I then call selectdata.m but it throws
??? Error using ==> figure
Requested figure handle in use by another object
Before calling selectdata (with no inputs, so everything default) I have tried:
subplot(handles.uipanelTscores)
figure(get(handles.uipanelTscores,'Parent'))
subplot(handles.axTscores.p)
figure(handles.axTscores.p)
axes(handles.axTscores.p)
all to no avail. I really need a method of lasso-selecting a group of points on this plot and returning the coordinates. Except for this obstacle, it seems that selectdata.m would be the perfect function for this. Any help would be much appreciated!
Phil

3 Kommentare

Walter Roberson
Walter Roberson am 12 Jun. 2012
Note: your plot(x,y,'o'); should be plot(handles.axTscores.p, x, y, 'o');
Phil
Phil am 14 Jun. 2012
Adding that in doesn't seem to affect the functionality in any way, since the focus is already on the subplot when I call plot, but I'm curious - what am I missing?
Tom
Tom am 14 Jun. 2012
If you don't need a complicated selection shape, you should consider using the rbbox function.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Graphics Performance finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 12 Jun. 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by