Skip to content

constrained_layout fails with hidden axis... #14918

@jklymak

Description

@jklymak

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

Metadata

Metadata

Assignees

Labels

topic: geometry managerLayoutEngine, Constrained layout, Tight layout

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy