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

Function test_annulus_setters2

lib/matplotlib/tests/test_patches.py:850–871  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

848
849@image_comparison(['annulus.png'], style='mpl20')
850def test_annulus_setters2():
851
852 fig, ax = plt.subplots()
853 cir = Annulus((0., 0.), 0.2, 0.01, fc='g') # circular annulus
854 ell = Annulus((0., 0.), (1, 2), 0.1, 0, # elliptical
855 fc='m', ec='b', alpha=0.5, hatch='xxx')
856 ax.add_patch(cir)
857 ax.add_patch(ell)
858 ax.set_aspect('equal')
859
860 cir.center = (0.5, 0.5)
861 cir.set_semimajor(0.2)
862 cir.set_semiminor(0.2)
863 assert cir.radii == (0.2, 0.2)
864 cir.width = 0.05
865
866 ell.center = (0.5, 0.5)
867 ell.set_semimajor(0.5)
868 ell.set_semiminor(0.3)
869 assert ell.radii == (0.5, 0.3)
870 ell.width = 0.1
871 ell.angle = 45
872
873
874def test_degenerate_polygon():

Callers

nothing calls this directly

Calls 6

set_semimajorMethod · 0.95
set_semiminorMethod · 0.95
AnnulusClass · 0.90
add_patchMethod · 0.80
subplotsMethod · 0.45
set_aspectMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…