We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5876d06 commit e8df9e5Copy full SHA for e8df9e5
1 file changed
lib/matplotlib/tests/test_axes.py
@@ -501,6 +501,16 @@ def test_twin_keeps_layout_participation_for_layout_managed_axes(twin):
501
assert ax2.get_in_layout()
502
503
504
+@pytest.mark.parametrize("twin", ("x", "y"))
505
+def test_twin_stays_aligned_after_tight_layout(twin):
506
+ fig,ax = plt.subplots()
507
+ ax2 = getattr(ax, f"twin{twin}")()
508
+
509
+ fig.tight_layout()
510
511
+ assert_allclose(ax.get_position().bounds, ax2.get_position().bounds)
512
513
514
def test_inverted_cla():
515
# GitHub PR #5450. Setting autoscale should reset
516
# axes to be non-inverted.
0 commit comments