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

1 Ansicht (letzte 30 Tage)
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

Akzeptierte Antwort

Rollin Baker
Rollin Baker am 13 Apr. 2017
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!

Weitere Antworten (0)

Kategorien

Mehr zu Specifying Target for Graphics Output finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by