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

Function test_visibility

lib/matplotlib/tests/test_backend_svg.py:23–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21
22
23def test_visibility():
24 fig, ax = plt.subplots()
25
26 x = np.linspace(0, 4 * np.pi, 50)
27 y = np.sin(x)
28 yerr = np.ones_like(y)
29
30 a, b, c = ax.errorbar(x, y, yerr=yerr, fmt='ko')
31 for artist in b:
32 artist.set_visible(False)
33
34 with BytesIO() as fd:
35 fig.savefig(fd, format='svg')
36 buf = fd.getvalue()
37
38 parser = xml.parsers.expat.ParserCreate()
39 parser.Parse(buf) # this will raise ExpatError if the svg is invalid
40
41
42@image_comparison(['fill_black_with_alpha.svg'], remove_text=True,

Callers

nothing calls this directly

Calls 4

subplotsMethod · 0.45
errorbarMethod · 0.45
set_visibleMethod · 0.45
savefigMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…