Skip to content

FIX constrained_layout w/ hidden axes#14919

Merged
anntzer merged 2 commits intomatplotlib:masterfrom
jklymak:fix-CL-hidden-axes
Aug 12, 2019
Merged

FIX constrained_layout w/ hidden axes#14919
anntzer merged 2 commits intomatplotlib:masterfrom
jklymak:fix-CL-hidden-axes

Conversation

@jklymak
Copy link
Copy Markdown
Member

@jklymak jklymak commented Jul 30, 2019

PR Summary

If an axes is hidden (set_visible(False)) then it has no tightbbox. But we still need to position it w/ constrained_layout, pointed out in #14917 (thanks @ImportanceOfBeingErnest )

Closes #14918

import numpy as np
import matplotlib.pyplot as plt

fig5, axs = plt.subplots(2, 2, constrained_layout=True)
axs[0,1].set_visible(False)
plt.show()

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: geometry manager LayoutEngine, Constrained layout, Tight layout

Projects

None yet

Development

Successfully merging this pull request may close these issues.

constrained_layout fails with hidden axis...

5 participants