Skip to content

Titles cannot be padded to negative numbers anymore. #16805

Closed
@ImportanceOfBeingErnest

Description

Bug report

Bug summary

Titles cannot be padded to negative numbers anymore.
Only if no xticklabels are on the axes, it still works as expected.

This broke in #13741 (sorry for approving that one)

Code for reproduction

import matplotlib.pyplot as plt

fig, (ax1, ax2) = plt.subplots(ncols=2)
for ax in (ax1, ax2):
    ax.set_title(f"Title 1", pad=-20)

ax1.tick_params(labelbottom=False)

plt.show()

Actual outcome

image

Expected outcome

image

Matplotlib version

  • Operating system:
  • Matplotlib version: 3.1
  • Matplotlib backend (print(matplotlib.get_backend())):
  • Python version:
  • Jupyter version (if applicable):
  • Other libraries:

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions