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

Function test_figure

lib/matplotlib/tests/test_figure.py:212–223  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

210@image_comparison(['figure_today.png'], style='mpl20',
211 tol=0 if platform.machine() == 'x86_64' else 0.022)
212def 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')

Callers

nothing calls this directly

Calls 6

figureMethod · 0.80
add_subplotMethod · 0.80
set_titleMethod · 0.45
get_labelMethod · 0.45
plotMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…