X Tutup
Skip to content

FontProperties size and weight ignored by figure.suptitle #6996

@dmkent

Description

@dmkent

Passing a FontProperties object to suptitle used to allow setting of font size and weight (in 1.4.*) however #3011 means the defaults from rcParams now override the font properties values.

Issue is somewhere in figure.py#L540.

Happy to put a PR together but not sure on best approach to solve.

Should we check to see if fontproperties is present before overriding? Do other methods handle this somewhere?

This used to work:

from matplotlib import pyplot as plt
from matplotlib.font_manager import FontProperties

fig = plt.figure()
fp = FontProperties(family="sans-serif", size="large", weight="bold")
txt = fig.suptitle('my title', fontproperties=fp)

assert txt.get_weight() == fp.get_weight()

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

      X Tutup