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 件)

カテゴリ

Help Center および File ExchangeSpecifying Target for Graphics Output についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by