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

Method rotated

lib/matplotlib/markers.py:397–424  ·  view source on GitHub ↗

Return a new version of this marker rotated by specified angle. Parameters ---------- deg : float, optional Rotation angle in degrees. rad : float, optional Rotation angle in radians. .. note:: You must specify exactly one o

(self, *, deg=None, rad=None)

Source from the content-addressed store, hash-verified

395 return new_marker
396
397 def rotated(self, *, deg=None, rad=None):
398 """
399 Return a new version of this marker rotated by specified angle.
400
401 Parameters
402 ----------
403 deg : float, optional
404 Rotation angle in degrees.
405
406 rad : float, optional
407 Rotation angle in radians.
408
409 .. note:: You must specify exactly one of deg or rad.
410 """
411 if deg is None and rad is None:
412 raise ValueError('One of deg or rad is required')
413 if deg is not None and rad is not None:
414 raise ValueError('Only one of deg and rad can be supplied')
415 new_marker = MarkerStyle(self)
416 if new_marker._user_transform is None:
417 new_marker._user_transform = Affine2D()
418
419 if deg is not None:
420 new_marker._user_transform.rotate_deg(deg)
421 if rad is not None:
422 new_marker._user_transform.rotate(rad)
423
424 return new_marker
425
426 def scaled(self, sx, sy=None):
427 """

Callers 1

Calls 4

MarkerStyleClass · 0.85
Affine2DClass · 0.85
rotate_degMethod · 0.80
rotateMethod · 0.45

Tested by 1