MCPcopy
hub / github.com/matplotlib/matplotlib / _set_square

Method _set_square

lib/matplotlib/markers.py:589–605  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

587 return self._set_triangle(270.0, 1)
588
589 def _set_square(self):
590 self._transform = Affine2D().translate(-0.5, -0.5)
591 self._snap_threshold = 2.0
592 if not self._half_fill():
593 self._path = Path.unit_rectangle()
594 else:
595 # Build a bottom filled square out of two rectangles, one filled.
596 self._path = Path([[0.0, 0.0], [1.0, 0.0], [1.0, 0.5],
597 [0.0, 0.5], [0.0, 0.0]])
598 self._alt_path = Path([[0.0, 0.5], [1.0, 0.5], [1.0, 1.0],
599 [0.0, 1.0], [0.0, 0.5]])
600 fs = self.get_fillstyle()
601 rotate = {'bottom': 0, 'right': 90, 'top': 180, 'left': 270}[fs]
602 self._transform.rotate_deg(rotate)
603 self._alt_transform = self._transform
604
605 self._joinstyle = self._user_joinstyle or JoinStyle.miter
606
607 def _set_diamond(self):
608 self._transform = Affine2D().translate(-0.5, -0.5).rotate_deg(45)

Callers

nothing calls this directly

Calls 7

_half_fillMethod · 0.95
get_fillstyleMethod · 0.95
Affine2DClass · 0.85
PathClass · 0.85
translateMethod · 0.80
unit_rectangleMethod · 0.80
rotate_degMethod · 0.80

Tested by

no test coverage detected