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

Method _set_triangle

lib/matplotlib/markers.py:547–575  ·  view source on GitHub ↗
(self, rot, skip)

Source from the content-addressed store, hash-verified

545 _triangle_path_r = Path._create_closed([[0, 1], [0, -1], [1, -1]])
546
547 def _set_triangle(self, rot, skip):
548 self._transform = Affine2D().scale(0.5).rotate_deg(rot)
549 self._snap_threshold = 5.0
550
551 if not self._half_fill():
552 self._path = self._triangle_path
553 else:
554 mpaths = [self._triangle_path_u,
555 self._triangle_path_l,
556 self._triangle_path_d,
557 self._triangle_path_r]
558
559 fs = self.get_fillstyle()
560 if fs == 'top':
561 self._path = mpaths[(0 + skip) % 4]
562 self._alt_path = mpaths[(2 + skip) % 4]
563 elif fs == 'bottom':
564 self._path = mpaths[(2 + skip) % 4]
565 self._alt_path = mpaths[(0 + skip) % 4]
566 elif fs == 'left':
567 self._path = mpaths[(1 + skip) % 4]
568 self._alt_path = mpaths[(3 + skip) % 4]
569 else:
570 self._path = mpaths[(3 + skip) % 4]
571 self._alt_path = mpaths[(1 + skip) % 4]
572
573 self._alt_transform = self._transform
574
575 self._joinstyle = self._user_joinstyle or JoinStyle.miter
576
577 def _set_triangle_up(self):
578 return self._set_triangle(0.0, 0)

Callers 4

_set_triangle_upMethod · 0.95
_set_triangle_downMethod · 0.95
_set_triangle_leftMethod · 0.95
_set_triangle_rightMethod · 0.95

Calls 5

_half_fillMethod · 0.95
get_fillstyleMethod · 0.95
Affine2DClass · 0.85
rotate_degMethod · 0.80
scaleMethod · 0.45

Tested by

no test coverage detected