Interactive image plotting with matplotlib?

Custom event handlers are what you are going to need for this. It's not hard, but it's not "it just works" either.

Up vote 1 down vote favorite share g+ share fb share tw.

I am transitioning from Matlab to NumPy/matplotlib. A feature in matplotlib that seems to be lacking is interactive plotting. Zooming and panning is useful, but a frequent use case for me is this: I plot a grayscale image using imshow() (both Matlab and matplotlib do well at this).

In the figure that comes up, I'd like to pinpoint a certain pixel (its x and y coordinates) and get its value. This is easy to do in the Matlab figure, but is there a way to do this in matplotlib? This appears to be close, but doesn't seem to be meant for images.

Matplotlib link|improve this question asked Sep 30 '11 at 19:07Rich Li236.

Custom event handlers are what you are going to need for this. It's not hard, but it's not "it just works" either. This question seems pretty close to what you are after.

If you need any clarification, I'd be happy to add more info.

That looks quite promising. I'll give it a try and let you know. I didn't find that question when I searched SO.

For my purposes, I don't need interpolated values, so retrieving the values from the image array is the best method for me. I appreciate the extensibility of matplotlib, but it sure would be nice to have stuff like this built-in. – Rich Li Sep 30 '11 at 23:49.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions