I have a 2D numpy array that I need to plot as an image with a certain scale. Within that image I need to be able to select a ROI or at least be able to display the mouse coordinates (of a specific target contained in the image). I tried using pyqtgraph but I can't seem to plot an image as a data source rather than just an image (i.e. can't seem to set axes, etc)... what would be the best way to do this, then? The image browser is compiled as a widget with a slider that scrolls through frames of the file; this widget is then embedded in a main window with a few table widgets.
Asked
Active
Viewed 1,126 times
1 Answers
1
I think imshow in matplotlib might work for you. It is easy to zoom, pan, and scale, and works easily with numpy.
(If this answer doesn't work for you, could you please refine your question. I'm unsure whether you're looking for any tool that will do the job, or something that works within the context of a gui that you've already implemented. If the later, I think you'll probably need to do the ROI yourself, by, say, selecting areas of the numpy array to plot, e.g. a[xmin:xmax, ymin:ymax].)

tom10
- 67,082
- 10
- 127
- 137
-
Thank you! I was indeed hoping for the later. I didn't think matplotlib was as flexible with GUI implementation, but it's looking like it'll be the best option. I've been fooling around with both pyqtgraph and guiqwt and seem to have hit dead ends with both. – Victoria Price Jul 27 '12 at 11:08
-
Can you embed matplotlib into you pyqt? I'm not sure what the issue you're referring to with "not as flexible with GUI...", but it's easy to embed. There are demos and another demo here: http://eli.thegreenplace.net/2009/01/20/matplotlib-with-pyqt-guis/ – tom10 Jul 27 '12 at 15:27