We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd998cd commit 427ff32Copy full SHA for 427ff32
lib/matplotlib/tests/test_axes.py
@@ -7527,6 +7527,18 @@ def test_bbox_aspect_axes_init():
7527
assert_allclose(sizes, sizes[0])
7528
7529
7530
+def test_set_aspect_negative():
7531
+ fig, ax = plt.subplots()
7532
+ with pytest.raises(ValueError, match="must be finite and positive"):
7533
+ ax.set_aspect(-1)
7534
7535
+ ax.set_aspect(0)
7536
7537
+ ax.set_aspect(np.inf)
7538
7539
+ ax.set_aspect(-np.inf)
7540
+
7541
7542
def test_redraw_in_frame():
7543
fig, ax = plt.subplots(1, 1)
7544
ax.plot([1, 2, 3])
0 commit comments