MCPcopy
hub / github.com/matplotlib/matplotlib / set_rotation_mode

Method set_rotation_mode

lib/matplotlib/text.py:353–373  ·  view source on GitHub ↗

Set text rotation mode. Parameters ---------- m : {None, 'default', 'anchor', 'xtick', 'ytick'} If ``"default"``, the text will be first rotated, then aligned according to their horizontal and vertical alignments. If ``"anchor"``, then

(self, m)

Source from the content-addressed store, hash-verified

351 return self._transform_rotates_text
352
353 def set_rotation_mode(self, m):
354 """
355 Set text rotation mode.
356
357 Parameters
358 ----------
359 m : {None, 'default', 'anchor', 'xtick', 'ytick'}
360 If ``"default"``, the text will be first rotated, then aligned according
361 to their horizontal and vertical alignments. If ``"anchor"``, then
362 alignment occurs before rotation. "xtick" and "ytick" adjust the
363 horizontal/vertical alignment so that the text is visually pointing
364 towards its anchor point. This is primarily used for rotated tick
365 labels and positions them nicely towards their ticks. Passing
366 ``None`` will set the rotation mode to ``"default"``.
367 """
368 if m is None:
369 m = "default"
370 else:
371 _api.check_in_list(("anchor", "default", "xtick", "ytick"), rotation_mode=m)
372 self._rotation_mode = m
373 self.stale = True
374
375 def get_rotation_mode(self):
376 """Return the text rotation mode."""

Callers 7

_get_wrap_line_widthMethod · 0.95
_draw_offset_textMethod · 0.80
_draw_labelsMethod · 0.80
__init__Method · 0.80
set_label_positionMethod · 0.80
__init__Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected