Skip to content

constrained_layout fails with hidden axis... #14918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jklymak opened this issue Jul 30, 2019 · 0 comments · Fixed by #14919
Closed

constrained_layout fails with hidden axis... #14918

jklymak opened this issue Jul 30, 2019 · 0 comments · Fixed by #14919
Assignees
Labels
topic: geometry manager LayoutEngine, Constrained layout, Tight layout
Milestone

Comments

@jklymak
Copy link
Member

jklymak commented Jul 30, 2019

Bug report

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()

will yield an error:

Traceback (most recent call last):
  File "/Users/jklymak/matplotlib/lib/matplotlib/backends/backend_qt5.py", line 488, in _draw_idle
    self.draw()
  File "/Users/jklymak/matplotlib/lib/matplotlib/backends/backend_agg.py", line 396, in draw
    self.figure.draw(self.renderer)
  File "/Users/jklymak/matplotlib/lib/matplotlib/artist.py", line 38, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/Users/jklymak/matplotlib/lib/matplotlib/figure.py", line 1711, in draw
    self.execute_constrained_layout(renderer)
  File "/Users/jklymak/matplotlib/lib/matplotlib/figure.py", line 2433, in execute_constrained_layout
    do_constrained_layout(fig, renderer, h_pad, w_pad, hspace, wspace)
  File "/Users/jklymak/matplotlib/lib/matplotlib/_constrained_layout.py", line 170, in do_constrained_layout
    _make_layout_margins(ax, renderer, h_pad, w_pad)
  File "/Users/jklymak/matplotlib/lib/matplotlib/_constrained_layout.py", line 275, in _make_layout_margins
    bbox = invTransFig(tightbbox)
  File "/Users/jklymak/matplotlib/lib/matplotlib/transforms.py", line 1452, in transform_bbox
    return Bbox(self.transform(bbox.get_points()))
AttributeError: 'NoneType' object has no attribute 'get_points'

Matplotlib version

  • Matplotlib version: Master
@jklymak jklymak self-assigned this Jul 30, 2019
@jklymak jklymak added the topic: geometry manager LayoutEngine, Constrained layout, Tight layout label Jul 30, 2019
@jklymak jklymak added this to the v3.2.0 milestone Jul 30, 2019
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 a pull request may close this issue.

1 participant