We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ce749b4 commit 5876d06Copy full SHA for 5876d06
1 file changed
lib/matplotlib/tests/test_axes.py
@@ -484,7 +484,21 @@ def test_twin_respects_position_after_set_position(twin):
484
ax.set_position([0.2, 0.2, 0.5, 0.5])
485
ax2 = getattr(ax, f"twin{twin}")()
486
487
- assert_allclose(ax.get_position().bounds, ax2.get_position().bounds)
+ assert_allclose(ax.get_position(original=True).bounds,
488
+ ax2.get_position(original=True).bounds)
489
+
490
+ assert_allclose(ax.get_position(original=False).bounds,
491
+ ax2.get_position(original=False).bounds)
492
493
494
+@pytest.mark.parametrize("twin", ("x", "y"))
495
+def test_twin_keeps_layout_participation_for_layout_managed_axes(twin):
496
+ fig, ax = plt.subplots()
497
498
+ ax2 = getattr(ax, f"twin{twin}")()
499
500
+ assert ax.get_in_layout()
501
+ assert ax2.get_in_layout()
502
503
504
def test_inverted_cla():
0 commit comments