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

Method _set_hexagon1

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

Source from the content-addressed store, hash-verified

668 self._joinstyle = self._user_joinstyle or JoinStyle.bevel
669
670 def _set_hexagon1(self):
671 self._transform = Affine2D().scale(0.5)
672 self._snap_threshold = None
673
674 polypath = Path.unit_regular_polygon(6)
675
676 if not self._half_fill():
677 self._path = polypath
678 else:
679 verts = polypath.vertices
680 # not drawing inside lines
681 x = np.abs(np.cos(5 * np.pi / 6.))
682 top = Path(np.concatenate([[(-x, 0)], verts[[1, 0, 5]], [(x, 0)]]))
683 bottom = Path(np.concatenate([[(-x, 0)], verts[2:5], [(x, 0)]]))
684 left = Path(verts[0:4])
685 right = Path(verts[[0, 5, 4, 3]])
686 self._path, self._alt_path = {
687 'top': (top, bottom), 'bottom': (bottom, top),
688 'left': (left, right), 'right': (right, left),
689 }[self.get_fillstyle()]
690 self._alt_transform = self._transform
691
692 self._joinstyle = self._user_joinstyle or JoinStyle.miter
693
694 def _set_hexagon2(self):
695 self._transform = Affine2D().scale(0.5).rotate_deg(30)

Callers

nothing calls this directly

Calls 6

_half_fillMethod · 0.95
get_fillstyleMethod · 0.95
Affine2DClass · 0.85
PathClass · 0.85
unit_regular_polygonMethod · 0.80
scaleMethod · 0.45

Tested by

no test coverage detected