Skip to content

Commit 481c578

Browse files
pllimdhomeier
andcommitted
Fix Affine transform wrt matplotlib
Co-authored-by: Derek Homeier <[email protected]>
1 parent a425fea commit 481c578

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

jdaviz/configs/imviz/plugins/rotate_image/rotate_image.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ def vue_rotate_image(self, *args, **kwargs):
2727

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

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

0 commit comments

Comments
 (0)