MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / drag_pan

Method drag_pan

lib/matplotlib/projections/polar.py:1478–1503  ·  view source on GitHub ↗
(self, button, key, x, y)

Source from the content-addressed store, hash-verified

1476 del self._pan_start
1477
1478 def drag_pan(self, button, key, x, y):
1479 p = self._pan_start
1480
1481 if p.mode == 'drag_r_labels':
1482 (startt, startr), (t, r) = p.trans_inverse.transform(
1483 [(p.x, p.y), (x, y)])
1484
1485 # Deal with theta
1486 dt = np.rad2deg(startt - t)
1487 self.set_rlabel_position(p.r_label_angle - dt)
1488
1489 trans, vert1, horiz1 = self.get_yaxis_text1_transform(0.0)
1490 trans, vert2, horiz2 = self.get_yaxis_text2_transform(0.0)
1491 for t in self.yaxis.majorTicks + self.yaxis.minorTicks:
1492 t.label1.set_va(vert1)
1493 t.label1.set_ha(horiz1)
1494 t.label2.set_va(vert2)
1495 t.label2.set_ha(horiz2)
1496
1497 elif p.mode == 'zoom':
1498 (startt, startr), (t, r) = p.trans_inverse.transform(
1499 [(p.x, p.y), (x, y)])
1500
1501 # Deal with r
1502 scale = r / startr
1503 self.set_rmax(p.rmax / scale)
1504
1505
1506# To keep things all self-contained, we can put aliases to the Polar classes

Callers

nothing calls this directly

Calls 5

set_rlabel_positionMethod · 0.95
set_rmaxMethod · 0.95
transformMethod · 0.45

Tested by

no test coverage detected