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

Function test_double_resize

lib/matplotlib/tests/test_backend_qt.py:249–265  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

247
248@pytest.mark.backend('QtAgg', skip_on_importerror=True)
249def test_double_resize():
250 # Check that resizing a figure twice keeps the same window size
251 fig, ax = plt.subplots()
252 fig.canvas.draw()
253 window = fig.canvas.manager.window
254
255 w, h = 3, 2
256 fig.set_size_inches(w, h)
257 assert fig.canvas.width() == w * matplotlib.rcParams['figure.dpi']
258 assert fig.canvas.height() == h * matplotlib.rcParams['figure.dpi']
259
260 old_width = window.width()
261 old_height = window.height()
262
263 fig.set_size_inches(w, h)
264 assert window.width() == old_width
265 assert window.height() == old_height
266
267
268@pytest.mark.backend('QtAgg', skip_on_importerror=True)

Callers

nothing calls this directly

Calls 5

set_size_inchesMethod · 0.80
widthMethod · 0.80
heightMethod · 0.80
subplotsMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…