8000 the affine matrix is calculated in the display coordinate for interpolation='none' by leejjoon · Pull Request #1150 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

the affine matrix is calculated in the display coordinate for interpolation='none' #1150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 5, 2012
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
for interpolation='none', the affine matrix is calculated in the disp…
…lay coordinate
  • Loading branch information
leejjoon committed Aug 27, 2012
commit 96ac546c0aaff36758ed24d2d9ff523fc1b44a60
13 changes: 7 additions & 6 deletions lib/matplotlib/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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]
Expand All @@ -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.
Expand Down
0