Skip to content

tight_layout does not work with set_visible(False) #8225

Closed
@ResidentMario

Description

@ResidentMario

Bug report

Bug summary

  • tight_layout() cooperates with axis('off') but not with set_visible(False).
  • cf. pandas#9351

Code for reproduction

This code fails:

import matplotlib.pyplot as plt
f, axarr = plt.subplots(2, 2)
axarr[1][1].set_visible(False)
plt.tight_layout()

This code succeeds:

import matplotlib.pyplot as plt
f, axarr = plt.subplots(2, 2)
axarr[1][1].axis('off')
plt.tight_layout()

Actual outcome

AttributeError: 'NoneType' object has no attribute 'is_bbox'

Expected outcome

selection_015

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions