MATLAB: GUI manual data selection

datauicontrol

Is it possible to have the user select a data value from a plot using a cursor click on the plot?

Best Answer

Yes. The actual implementation depends on the type of the plot.
H = plot(1:10);
set(H, 'ButtonDownFcn', @myCallback);
function myCallback(ObjH, EvenData)
set(ObjH, 'Color', rand(1, 3));
AxesH = ancestor(ObjH, 'axes');
disp(get(AxesH, 'CurrentPoint'));