|
"Daniel " <djs32@buffalo.edu> wrote in message <ggf5tp$bp4$1@fred.mathworks.com>...
> Thank you for responding to my post Matt.
>
> I have tried HitTest on and off and no matter what I do the ButtonDownFcn callback is not called after plotting. This is the problem; the button click event is never raised.
>
> My gui M-File has the following function (breakpoint on cp line):
>
> function contour_plot_ButtonDownFcn(hObject, eventdata, handles)
> cp=get(hObject,'CurrentPoint')
>
> When clicking the contour_plot this event is never stopped at the breakpoint.
>
> Any ideas?
>
> Thanks,
> -Dan
the problem is probably in the order that you're setting properties, because contour is going to reset the axes properties. the following code works:
function test
f=figure;
a=axes;
handles=[];
[X,Y]=meshgrid([1 2 3 4 5],[6 7 8 9]);
Z=X.^2+log(Y);
c=contour(X,Y,Z);
set(a,'buttondownfcn',{@contour_plot_ButtonDownFcn,handles},'hittest','on')
function contour_plot_ButtonDownFcn(hObject, eventdata, handles)
cp=get(hObject,'CurrentPoint')
|