8000 Adding documentation for Text.fontfamily default, set_fontfamily(None)? · Issue #13880 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Adding documentation for Text.fontfamily default, set_fontfamily(None)? #13880
Closed
@nyanpasu64

Description

@nyanpasu64

Bug report

Bug summary

Documentation for matplotlib.text.Text.set_fontfamily (https://matplotlib.org/api/text_api.html#matplotlib.text.Text.set_fontfamily ) could be edited to explain:

  • its value defaults to matplotlib.rcParams['font.family']
  • constructing Text(fontfamily=None) sets font to matplotlib.rcParams['font.family']
  • calling set_fontfamily() on an existing Text instance does the same thing
    • pycharm complains that "Expected type 'str', got 'None' instead", but the program works fine at runtime.

(Also https://matplotlib.org/api/font_manager_api.html#matplotlib.font_manager.FontProperties.set_family should be edited too.)

I confirmed the behaviors by editing my program:

  • edit rcParams
  • create Text (actually Annotation which subclasses Text) via Axes.annotate

FontProperties._family starts out at rcParams['font.family'], and .set_family(None) replaces argument with rcParams['font.family'], (both call _normalize_font_family() afterwards).

I'm not sure when this behavior was introduced.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0