| 210 | @image_comparison(['figure_today.png'], style='mpl20', |
| 211 | tol=0 if platform.machine() == 'x86_64' else 0.022) |
| 212 | def test_figure(): |
| 213 | # named figure support |
| 214 | fig = plt.figure('today') |
| 215 | ax = fig.add_subplot() |
| 216 | ax.set_title(fig.get_label()) |
| 217 | ax.plot(np.arange(5)) |
| 218 | # plot red line in a different figure. |
| 219 | plt.figure('tomorrow') |
| 220 | plt.plot([0, 1], [1, 0], 'r') |
| 221 | # Return to the original; make sure the red line is not there. |
| 222 | plt.figure('today') |
| 223 | plt.close('tomorrow') |
| 224 | |
| 225 | |
| 226 | @image_comparison(['figure_legend.png'], style='mpl20') |