Thanks to visit codestin.com Credit goes to github.com
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 e8df9e5 commit c2a343cCopy full SHA for c2a343c
1 file changed
lib/matplotlib/tests/test_axes.py
@@ -502,11 +502,13 @@ def test_twin_keeps_layout_participation_for_layout_managed_axes(twin):
502
503
504
@pytest.mark.parametrize("twin", ("x", "y"))
505
-def test_twin_stays_aligned_after_tight_layout(twin):
506
- fig,ax = plt.subplots()
+def test_twin_stays_aligned_after_constrained_layout(twin):
+ fig, ax = plt.subplots(constrained_layout=True)
507
+
508
+ ax.set_position([0.2, 0.2, 0.5, 0.5])
509
ax2 = getattr(ax, f"twin{twin}")()
510
- fig.tight_layout()
511
+ fig.canvas.draw()
512
513
assert_allclose(ax.get_position().bounds, ax2.get_position().bounds)
514
0 commit comments