How to display different graphs depending on the position of the mouse pointer on an image?

1 次查看(过去 30 天)
Hello,
I have an image and for each pixel, I compute a vector V. I store all my data in a 3D matrix.
I would like to move the mouse pointer over the image and to display at the same time the vector V in a plot next to the image. Is it possible to do this in MATLAB?
It would be something similar to impixelinfo, but instead of getting the pixel position and intensity, I would get a plot with a curve.
Thanks for the answer!
Best regards, Guillaume

采纳的回答

Rollin Baker
Rollin Baker 2017-4-13
Hi Guillaume,
If your image is on a figure, then you could use the 'WindowButtonMotionFcn' callback to invoke a custom function that calls 'plot'. This won't do exactly the same thing as impixelinfo, since the object that contains the text is generated differently than a plot figure, but you may be able to find ways to modify the callback to suit your needs. If this sounds like something that would work, try checking out the documentation page for the callback below:
I hope you find this helpful. Good luck on your project!

更多回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by