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

Function test_parent_axes_removal

lib/matplotlib/tests/test_widgets.py:1837–1857  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1835
1836
1837def test_parent_axes_removal():
1838
1839 fig, (ax_radio, ax_checks) = plt.subplots(1, 2)
1840
1841 radio = widgets.RadioButtons(ax_radio, ['1', '2'], 0)
1842 checks = widgets.CheckButtons(ax_checks, ['1', '2'], [True, False])
1843
1844 ax_checks.remove()
1845 ax_radio.remove()
1846 with io.BytesIO() as out:
1847 # verify that saving does not raise
1848 fig.savefig(out, format='raw')
1849
1850 # verify that this method which is triggered by a draw_event callback when
1851 # blitting is enabled does not raise. Calling private methods is simpler
1852 # than trying to force blitting to be enabled with Agg or use a GUI
1853 # framework.
1854 renderer = fig._get_renderer()
1855 evt = DrawEvent('draw_event', fig.canvas, renderer)
1856 radio._clear(evt)
1857 checks._clear(evt)
1858
1859
1860def test_cursor_overlapping_axes_blitting_warning():

Callers

nothing calls this directly

Calls 6

DrawEventClass · 0.90
subplotsMethod · 0.45
removeMethod · 0.45
savefigMethod · 0.45
_get_rendererMethod · 0.45
_clearMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…