Thursday, April 12, 2012

matplotlib: Rescale colors of imshow after zooming in

I'm trying to plot a 2D field using imshow. I'd like the colors to rescale after zooming in so I can see more detail.

The only solution I know of is to take the coordinates of the box returned by a RectangleSelector event and replot a submatrix of the original data. Is there a better solution?

1 comment:

  1. After doing a lot of searching, I couldn't find any alternatives. However, implementing this with the RectangleSelector and just replotting a submatrix of the original data turned out to work well.