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

Method _set_hexagon2

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

Source from the content-addressed store, hash-verified

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)
696 self._snap_threshold = None
697
698 polypath = Path.unit_regular_polygon(6)
699
700 if not self._half_fill():
701 self._path = polypath
702 else:
703 verts = polypath.vertices
704 # not drawing inside lines
705 x, y = np.sqrt(3) / 4, 3 / 4.
706 top = Path(verts[[1, 0, 5, 4, 1]])
707 bottom = Path(verts[1:5])
708 left = Path(np.concatenate([
709 [(x, y)], verts[:3], [(-x, -y), (x, y)]]))
710 right = Path(np.concatenate([
711 [(x, y)], verts[5:2:-1], [(-x, -y)]]))
712 self._path, self._alt_path = {
713 'top': (top, bottom), 'bottom': (bottom, top),
714 'left': (left, right), 'right': (right, left),
715 }[self.get_fillstyle()]
716 self._alt_transform = self._transform
717
718 self._joinstyle = self._user_joinstyle or JoinStyle.miter
719
720 def _set_octagon(self):
721 self._transform = Affine2D().scale(0.5)

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected