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

Method unit_regular_star

lib/matplotlib/path.py:814–835  ·  view source on GitHub ↗

Return a :class:`Path` for a unit regular star with the given numVertices and radius of 1.0, centered at (0, 0).

(cls, numVertices, innerCircle=0.5)

Source from the content-addressed store, hash-verified

812
813 @classmethod
814 def unit_regular_star(cls, numVertices, innerCircle=0.5):
815 """
816 Return a :class:`Path` for a unit regular star with the given
817 numVertices and radius of 1.0, centered at (0, 0).
818 """
819 if numVertices <= 16:
820 path = cls._unit_regular_stars.get((numVertices, innerCircle))
821 else:
822 path = None
823 if path is None:
824 ns2 = numVertices * 2
825 theta = (2*np.pi/ns2 * np.arange(ns2 + 1))
826 # This initial rotation is to make sure the polygon always
827 # "points-up"
828 theta += np.pi / 2.0
829 r = np.ones(ns2 + 1)
830 r[1::2] = innerCircle
831 verts = (r * np.vstack((np.cos(theta), np.sin(theta)))).T
832 path = cls(verts, closed=True, readonly=True)
833 if numVertices <= 16:
834 cls._unit_regular_stars[(numVertices, innerCircle)] = path
835 return path
836
837 @classmethod
838 def unit_regular_asterisk(cls, numVertices):

Callers 14

unit_regular_asteriskMethod · 0.80
_set_tuple_markerMethod · 0.80
_set_starMethod · 0.80
__init__Method · 0.80
plot_pathsFunction · 0.80
test_clip_to_bboxFunction · 0.80

Calls 1

getMethod · 0.45

Tested by 9

plot_pathsFunction · 0.64
test_clip_to_bboxFunction · 0.64
test_clippingFunction · 0.64