Eric, I should have left more comments about my change. The issue is that the current slicing algorithm sometimes fails with "_draw_unsampled_image" which support arbitrary affine transformation of the image. The slicing gets wrong when the image is significantly skewed or rotated. So, as a temporary measure, I simply wanted to disable the slicing until we have a correct algorithm in place.
I guess a quick (still temporary) fix is to check if affine transform is needed, and do the slicing if not. Something like below. The condition is not exactly correct, but I think it would work in most of cases. I actually didn't test the patch. I'll be out of town until the end of this week. On a second thought, I think it should not be difficult to workaround the slicing thing for arbitrary affine transform. I'll think about the whole issue again when I get back. If you have a better idea, please go ahead and implement. Regards, -JJ diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index 7c1128f..b65f446 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -248,9 +248,14 @@ class _AxesImageBase(martist.Artist, cm.ScalarMappable): """ + if self._image_skew_coordinate: + no_slice = True + else: + no_slice = False + im, xmin, ymin, dxintv, dyintv, sx, sy = \ self._get_unsampled_image(self._A, self.get_extent(), - self.axes.viewLim, noslice=True) + self.axes.viewLim, noslice=no_slice) if im is None: return # I'm not if this check is required. -JJL On Tue, Jun 22, 2010 at 8:45 PM, Eric Firing <efir...@hawaii.edu> wrote: > JJ, > > In AxesImageBase._draw_unsampled_image, there is a call to > _get_unsampled_image(...noslice=True). When using imshow(Z, > interpolation='nearest'), this defeats the slicing that makes such a > difference when zooming and panning a small chunk of a large image. Changing > it to False makes imshow work better; I don't understand why one would ever > want noslice=True. Am I missing something? Can we just change it to False? > Or remove the noslice option and kwarg entirely? > > Eric > ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel