()
| 21 | |
| 22 | |
| 23 | def 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, |
nothing calls this directly
no test coverage detected
searching dependent graphs…