Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

ButtonDownFnc does not work with the axes

Status
Not open for further replies.

opat

Computer
Joined
Oct 20, 2005
Messages
1
Location
PL
Hi all, I have a problem while using ButtonDownFnc callback with an axes. I want to read the value of the plot and send it to editText field when I press mouse button over the plot. I am using this code in:

function axes2_ButtonDownFcn(hObject, eventdata, handles)

handles.Z = eval(handles.wzor1); %it reads the equation which I'm ploting
ac_exec =get(gcbo,'parent'); %it gets the parent object of actual callback
xy=get(handles.ac_exec,'CurrentPoint')
z=interp2(x,y,Z,xy(1),xy(2))
handles.zamieniony= num2str(handles.z);
set(handles.akt_wartosc_edit, 'String', handles.zamieniony);

The plot the GUI making participate two simple plots. I make them by a contour function. Maybe they change values of some important variables needed by a ButtonDownFnc?? Unfortunatly I don't know for sure.

Please help me with it.

PS Sorry, for my English, I don't know it well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top