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 CenterFile Exchange에서 Specifying 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