From 38474719d52a3cbc20938399a28bf034a1875632 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Fri, 8 Mar 2019 11:16:43 +0100 Subject: [PATCH] Simplify PolarAxes.can_pan. In the modified code, dt0 is always == -dt1 so they have the same absolute value and the else clause is always triggered. This is used in polar pan mode, which, when using the left mouse button, allows one to move the radial tick labels around... (the right mouse button allows zooming in and out (changing rmax, which seems less obscure.) --- lib/matplotlib/projections/polar.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/matplotlib/projections/polar.py b/lib/matplotlib/projections/polar.py index dfe31967deb0..dd334591db79 100644 --- a/lib/matplotlib/projections/polar.py +++ b/lib/matplotlib/projections/polar.py @@ -1398,13 +1398,7 @@ def drag_pan(self, button, key, x, y): t, r = p.trans_inverse.transform_point((x, y)) # Deal with theta - dt0 = t - startt - dt1 = startt - t - if abs(dt1) < abs(dt0): - dt = abs(dt1) * np.sign(dt0) * -1.0 - else: - dt = dt0 * -1.0 - dt = (dt / np.pi) * 180.0 + dt = np.rad2deg(startt - t) self.set_rlabel_position(p.r_label_angle - dt) trans, vert1, horiz1 = self.get_yaxis_text1_transform(0.0)