()
| 26 | |
| 27 | |
| 28 | def test_figure_to_svg(): |
| 29 | # simple empty-figure test |
| 30 | fig = plt.figure() |
| 31 | nt.assert_equal(pt.print_figure(fig, 'svg'), None) |
| 32 | |
| 33 | plt.close('all') |
| 34 | |
| 35 | # simple check for at least svg-looking output |
| 36 | fig = plt.figure() |
| 37 | ax = fig.add_subplot(1,1,1) |
| 38 | ax.plot([1,2,3]) |
| 39 | plt.draw() |
| 40 | svg = pt.print_figure(fig, 'svg')[:100].lower() |
| 41 | nt.assert_in(u'doctype svg', svg) |
| 42 | |
| 43 | def _check_pil_jpeg_bytes(): |
| 44 | """Skip if PIL can't write JPEGs to BytesIO objects""" |