Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
FIX: get twin
  • Loading branch information
jklymak committed Apr 10, 2022
commit a1278860792954e9fc05faa47d362c41cc4b1433
6 changes: 4 additions & 2 deletions lib/matplotlib/_tight_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,12 @@ def get_subplotspec_list(axes_list, grid_spec=None):

if axes_or_locator is None:
axes_or_locator = ax
elif hasattr(ax, '_twinned_axes'):
else:
for a in ax._twinned_axes.get_siblings(ax):
if a != ax and hasattr(a, "get_subplotspec"):
axes_or_locator = a
axes_or_locator = a.get_axes_locator()
if axes_or_locator is None:
axes_or_locator = a

if hasattr(axes_or_locator, "get_subplotspec"):
subplotspec = axes_or_locator.get_subplotspec()
Expand Down