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

Function test_arc_ellipse

lib/matplotlib/tests/test_axes.py:1832–1865  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1830
1831@image_comparison(['arc_ellipse'], remove_text=True, style='_classic_test')
1832def test_arc_ellipse():
1833 xcenter, ycenter = 0.38, 0.52
1834 width, height = 1e-1, 3e-1
1835 angle = -30
1836
1837 theta = np.deg2rad(np.arange(360))
1838 x = width / 2. * np.cos(theta)
1839 y = height / 2. * np.sin(theta)
1840
1841 rtheta = np.deg2rad(angle)
1842 R = np.array([
1843 [np.cos(rtheta), -np.sin(rtheta)],
1844 [np.sin(rtheta), np.cos(rtheta)]])
1845
1846 x, y = np.dot(R, [x, y])
1847 x += xcenter
1848 y += ycenter
1849
1850 fig = plt.figure()
1851 ax = fig.add_subplot(211, aspect='auto')
1852 ax.fill(x, y, alpha=0.2, facecolor='yellow', edgecolor='yellow',
1853 linewidth=1, zorder=1)
1854
1855 e1 = mpatches.Arc((xcenter, ycenter), width, height,
1856 angle=angle, linewidth=2, fill=False, zorder=2)
1857
1858 ax.add_patch(e1)
1859
1860 ax = fig.add_subplot(212, aspect='equal')
1861 ax.fill(x, y, alpha=0.2, facecolor='green', edgecolor='green', zorder=1)
1862 e2 = mpatches.Arc((xcenter, ycenter), width, height,
1863 angle=angle, linewidth=2, fill=False, zorder=2)
1864
1865 ax.add_patch(e2)
1866
1867
1868def test_marker_as_markerstyle():

Callers

nothing calls this directly

Calls 5

dotMethod · 0.80
figureMethod · 0.80
add_subplotMethod · 0.80
add_patchMethod · 0.80
fillMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…