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

Method _va_for_angle

lib/matplotlib/text.py:1555–1566  ·  view source on GitHub ↗

Determines vertical alignment ('va') for rotation_mode "ytick" based on the angle of rotation in degrees and the horizontal alignment.

(self, angle)

Source from the content-addressed store, hash-verified

1553 return 'right' if anchor_at_bottom else 'left'
1554
1555 def _va_for_angle(self, angle):
1556 """
1557 Determines vertical alignment ('va') for rotation_mode "ytick" based on
1558 the angle of rotation in degrees and the horizontal alignment.
1559 """
1560 anchor_at_left = self.get_horizontalalignment() == 'left'
1561 if (angle <= 10 or 350 <= angle or 170 <= angle <= 190
1562 or 80 <= angle <= 100 or 260 <= angle <= 280):
1563 return 'center'
1564 elif 190 < angle < 260 or 10 < angle < 80:
1565 return 'baseline' if anchor_at_left else 'top'
1566 return 'top' if anchor_at_left else 'baseline'
1567
1568 def get_language(self):
1569 """Return the language this Text is in."""

Callers 2

_get_layoutMethod · 0.95
test_va_for_angleFunction · 0.95

Calls 1

Tested by 1

test_va_for_angleFunction · 0.76