Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1d7bbf9

Browse filesBrowse files
committed
Explicitly test set figure width/height
1 parent 5cd30d2 commit 1d7bbf9
Copy full SHA for 1d7bbf9

File tree

Expand file treeCollapse file tree

1 file changed

+7
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-2
lines changed

‎lib/matplotlib/tests/test_backend_qt.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_backend_qt.py
+7-2Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import matplotlib
66
from matplotlib import pyplot as plt
7+
from matplotlib import rcParams
78
from matplotlib._pylab_helpers import Gcf
89

910
import pytest
@@ -281,10 +282,14 @@ def test_double_resize():
281282
fig.canvas.draw()
282283
window = fig.canvas.manager.window
283284

284-
fig.set_size_inches(2, 2)
285+
w, h = 3, 2
286+
fig.set_size_inches(w, h)
287+
assert fig.canvas.width() == w * rcParams['figure.dpi']
288+
assert fig.canvas.height() == h * rcParams['figure.dpi']
289+
285290
old_width = window.width()
286291
old_height = window.height()
287292

288-
fig.set_size_inches(2, 2)
293+
fig.set_size_inches(w, h)
289294
assert window.width() == old_width
290295
assert window.height() == old_height

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.