Prev: simulink error while conversion from serial to parallel using buffer
Next: using value from previous iteration-fminunc
From: Matt Fig on 19 May 2010 19:09 You might benefit from using the answer to question #29: http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples That will get you the coordinates. Then to get the color, you can use the buttondownfcn of each individual plot.
From: Jean on 20 May 2010 08:46 Thank you again Matt, Unfortunately, my problem is that the code i posted works perfect in an application i did a year ago (and it still works). Now if I try the same thing on a new application I have no errors, but it does not give me the coordinates of the current point when I click on a plot. I appreciate your advice and your expertise, Jean. "Matt Fig" <spamanon(a)yahoo.com> wrote in message <ht1r2h$rei$1(a)fred.mathworks.com>... > You might benefit from using the answer to question #29: > > http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples > > That will get you the coordinates. Then to get the color, you can use the buttondownfcn of each individual plot.
From: Jean on 24 May 2010 18:34 Hello, After many attempts, I managed to solve the problem. The solution is assigning the same axes button down function to the plot I am doing into the axes: pp3 = plot(handles.axes3,dp3,'r'); set(pp3,'ButtonDownFcn',@axes1_ButtonDownFcn); After that everything worked fine. A good day to you, Jean. "Jean " <domnul_jan(a)yahoo.com> wrote in message <ht3aub$a3n$1(a)fred.mathworks.com>... > Thank you again Matt, > > Unfortunately, my problem is that the code i posted works perfect in an application i did a year ago (and it still works). Now if I try the same thing on a new application I have no errors, but it does not give me the coordinates of the current point when I click on a plot. > > I appreciate your advice and your expertise, > Jean. > > > > "Matt Fig" <spamanon(a)yahoo.com> wrote in message <ht1r2h$rei$1(a)fred.mathworks.com>... > > You might benefit from using the answer to question #29: > > > > http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples > > > > That will get you the coordinates. Then to get the color, you can use the buttondownfcn of each individual plot.
From: Eli on 26 May 2010 03:52 Hi Jean, I had the same problem and your solution worked for me - thank! Just one thing - In my case I used imagesc to display an image (rather than plot), and I had to set the image handle HitTest property to 'on' in addition to setting its button down property to the required function. Thanks Rachel "Jean " <domnul_jan(a)yahoo.com> wrote in message <hteust$9u1$1(a)fred.mathworks.com>... > Hello, > > After many attempts, I managed to solve the problem. The solution is assigning the same axes button down function to the plot I am doing into the axes: > > pp3 = plot(handles.axes3,dp3,'r'); > set(pp3,'ButtonDownFcn',@axes1_ButtonDownFcn); > > After that everything worked fine. > > > A good day to you, > Jean. > > > > > > > "Jean " <domnul_jan(a)yahoo.com> wrote in message <ht3aub$a3n$1(a)fred.mathworks.com>... > > Thank you again Matt, > > > > Unfortunately, my problem is that the code i posted works perfect in an application i did a year ago (and it still works). Now if I try the same thing on a new application I have no errors, but it does not give me the coordinates of the current point when I click on a plot. > > > > I appreciate your advice and your expertise, > > Jean. > > > > > > > > "Matt Fig" <spamanon(a)yahoo.com> wrote in message <ht1r2h$rei$1(a)fred.mathworks.com>... > > > You might benefit from using the answer to question #29: > > > > > > http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples > > > > > > That will get you the coordinates. Then to get the color, you can use the buttondownfcn of each individual plot.
From: Eli on 26 May 2010 03:56
Hi Jean, I had the same problem and your solution worked for me - thank! Just one thing - In my case I used imagesc to display an image (rather than plot), and I had to set the image handle HitTest property to 'on' in addition to setting its button down property to the required function. Thanks Rachel "Jean " <domnul_jan(a)yahoo.com> wrote in message <hteust$9u1$1(a)fred.mathworks.com>... > Hello, > > After many attempts, I managed to solve the problem. The solution is assigning the same axes button down function to the plot I am doing into the axes: > > pp3 = plot(handles.axes3,dp3,'r'); > set(pp3,'ButtonDownFcn',@axes1_ButtonDownFcn); > > After that everything worked fine. > > > A good day to you, > Jean. > > > > > > > "Jean " <domnul_jan(a)yahoo.com> wrote in message <ht3aub$a3n$1(a)fred.mathworks.com>... > > Thank you again Matt, > > > > Unfortunately, my problem is that the code i posted works perfect in an application i did a year ago (and it still works). Now if I try the same thing on a new application I have no errors, but it does not give me the coordinates of the current point when I click on a plot. > > > > I appreciate your advice and your expertise, > > Jean. > > > > > > > > "Matt Fig" <spamanon(a)yahoo.com> wrote in message <ht1r2h$rei$1(a)fred.mathworks.com>... > > > You might benefit from using the answer to question #29: > > > > > > http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples > > > > > > That will get you the coordinates. Then to get the color, you can use the buttondownfcn of each individual plot. |