Skip to content

Commit

Permalink
Fix Affine transform wrt matplotlib
Browse files Browse the repository at this point in the history
Co-authored-by: Derek Homeier <[email protected]>
  • Loading branch information
pllim and dhomeier committed Aug 11, 2022
1 parent 0d43121 commit e62f3e9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jdaviz/configs/imviz/plugins/rotate_image/rotate_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def vue_rotate_image(self, *args, **kwargs):

# Rotate selected viewer canvas.
# TODO: This changes zoom too? astrofrog will fix translation issue?
affine_transform = Affine2D().rotate_deg(self._theta)
y_hub = (viewer.scales['y'].min + viewers.scales['y'].max) / 2
x_hub = (viewer.scales['x'].min + viewer.scales['x'].max) / 2
affine_transform = Affine2D().rotate_deg_around(y_hub, x_hub, self._theta)
viewer.state.affine_matrix = affine_transform

# TODO: Does the zoom box behave? If not, we need to disable it.
Expand Down

0 comments on commit e62f3e9

Please sign in to comment.