File tree 1 file changed +11
-0
lines changed
Filter options
1 file changed +11
-0
lines changed
Original file line number Diff line number Diff line change @@ -3654,12 +3654,23 @@ def _clip_to_axes(self, x, y):
3654
3654
3655
3655
min_lim = (xlim [0 ], ylim [0 ])
3656
3656
max_lim = (xlim [1 ], ylim [1 ])
3657
+
3657
3658
# Axes limits in display coordinates
3658
3659
min_lim = self .ax .transData .transform (min_lim )
3659
3660
max_lim = self .ax .transData .transform (max_lim )
3660
3661
3662
+ # For axes where the limits are reversed, need to make sure the
3663
+ # display min/max are in the correct order.
3664
+
3665
+ if min_lim [0 ] > max_lim [0 ]:
3666
+ min_lim [0 ], max_lim [0 ] = max_lim [0 ], min_lim [0 ]
3667
+
3668
+ if min_lim [1 ] > max_lim [1 ]:
3669
+ min_lim [1 ], max_lim [1 ] = max_lim [1 ], min_lim [1 ]
3670
+
3661
3671
x = np .clip (x , min_lim [0 ], max_lim [0 ])
3662
3672
y = np .clip (y , min_lim [1 ], max_lim [1 ])
3673
+
3663
3674
return x , y
3664
3675
3665
3676
# TODO: _draw_shape can be removed in 3.7
You can’t perform that action at this time.
0 commit comments