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

Method set_rotation

lib/matplotlib/text.py:1389–1408  ·  view source on GitHub ↗

Set the rotation of the text. Parameters ---------- s : float or {'vertical', 'horizontal'} The rotation angle in degrees in mathematically positive direction (counterclockwise). 'horizontal' equals 0, 'vertical' equals 90.

(self, s)

Source from the content-addressed store, hash-verified

1387 self.stale = True
1388
1389 def set_rotation(self, s):
1390 """
1391 Set the rotation of the text.
1392
1393 Parameters
1394 ----------
1395 s : float or {'vertical', 'horizontal'}
1396 The rotation angle in degrees in mathematically positive direction
1397 (counterclockwise). 'horizontal' equals 0, 'vertical' equals 90.
1398 """
1399 if isinstance(s, Real):
1400 self._rotation = float(s) % 360
1401 elif cbook._str_equal(s, 'horizontal') or s is None:
1402 self._rotation = 0.
1403 elif cbook._str_equal(s, 'vertical'):
1404 self._rotation = 90.
1405 else:
1406 raise ValueError("rotation must be 'vertical', 'horizontal' or "
1407 f"a number, not {s}")
1408 self.stale = True
1409
1410 def set_transform_rotates_text(self, t):
1411 """

Callers 15

_draw_offset_textMethod · 0.80
_draw_labelsMethod · 0.80
drawMethod · 0.80
get_window_extentMethod · 0.80
set_default_angleMethod · 0.80
test_labelbaseFunction · 0.80
autofmt_xdateMethod · 0.80
update_positionMethod · 0.80
update_positionMethod · 0.80
test_matshowMethod · 0.80
test_scatterMethod · 0.80

Calls

no outgoing calls

Tested by 10

test_labelbaseFunction · 0.64
test_matshowMethod · 0.64
test_scatterMethod · 0.64
test_xtick_rotation_modeFunction · 0.64
test_ytick_rotation_modeFunction · 0.64
test_align_labelsFunction · 0.64
test_align_titlesFunction · 0.64