From: Matt Fig on
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
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
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
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
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.