Permalink
Browse files

for interpolation='none', the affine matrix is calculated in the disp…

…lay coordinate
  • Loading branch information...
1 parent 0ee82be commit 96ac546c0aaff36758ed24d2d9ff523fc1b44a60 @leejjoon committed Aug 27, 2012
Showing with 7 additions and 6 deletions.
  1. +7 −6 lib/matplotlib/image.py
View
@@ -25,7 +25,7 @@
# the image namespace:
from matplotlib._image import *
-from matplotlib.transforms import BboxBase, Bbox
+from matplotlib.transforms import BboxBase, Bbox, IdentityTransform
import matplotlib.transforms as mtransforms
@@ -270,8 +270,8 @@ def _draw_unsampled_image(self, renderer, gc):
# firs, convert the image extent to the ic
x_llc, x_trc, y_llc, y_trc = self.get_extent()
- xy = trans.transform_non_affine(np.array([(x_llc, y_llc),
- (x_trc, y_trc)]))
+ xy = trans.transform(np.array([(x_llc, y_llc),
+ (x_trc, y_trc)]))
_xx1, _yy1 = xy[0]
_xx2, _yy2 = xy[1]
@@ -283,15 +283,16 @@ def _draw_unsampled_image(self, renderer, gc):
if self._image_skew_coordinate:
# skew the image when required.
x_lrc, y_lrc = self._image_skew_coordinate
- xy2 = trans.transform_non_affine(np.array([(x_lrc, y_lrc)]))
+ xy2 = trans.transform(np.array([(x_lrc, y_lrc)]))
_xx3, _yy3 = xy2[0]
tr_rotate_skew = self._get_rotate_and_skew_transform(_xx1, _yy1,
_xx2, _yy2,
_xx3, _yy3)
- trans_ic_to_canvas = tr_rotate_skew+trans.get_affine()
+ trans_ic_to_canvas = tr_rotate_skew
else:
- trans_ic_to_canvas = trans.get_affine()
+ trans_ic_to_canvas = IdentityTransform()
+
# Now, viewLim in the ic. It can be rotated and can be
# skewed. Make it big enough.

0 comments on commit 96ac546

Please sign in to comment.