Skip to content

Suptitle positioning messed up in 3.4.0 #19803

Closed
@emazep

Description

@emazep

If I run the following code:

import matplotlib.pyplot as plt
plt.subplots()
plt.suptitle('SUPTITLE TEST')

I get:

image

which says that the title is placed in x=0.5, y=0.98 (which, according to the docs, is its default position). However if I do:

plt.suptitle('SUPTITLE TEST', x=0.5, y=0.98)

it still says that the text is placed in x=0.5, y=0.98, but it is completely disappeared:

image

I think because it goes out of the image boundaries, as if I do:

plt.suptitle('SUPTITLE TEST', y=0.93)

I get the title vertically cut, instead of obtaining the space to accommodate it:

image

Also, setting x to any value but not setting y, such as in:

plt.suptitle('SUPTITLE TEST', x=0.5)

makes the title disappear as well:

image

I can also cut the title horizontally, for example with:

plt.suptitle('SUPTITLE TEST', x=0.1, y=0.92)

which produces:

image

Basically I cannot position the title anymore, while it was easily doable until 3.3.4.

Thank you.

Matplotlib version

  • Operating system: any
  • Matplotlib version: 3.4.0
  • Matplotlib backend: module://ipykernel.pylab.backend_inline
  • Python version: 3.9.2

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