Skip to content

[Doc]: Clarification of relative font sizes #30437

@DominikStiller

Description

@DominikStiller

Documentation Link

https://matplotlib.org/devdocs/users/explain/text/text_props.html

Problem

  • The fontsize property mentions relative sizes ("e.g., 'smaller', 'x-large'"), but no full list of supported values or how they scale the default font size.
  • Relatedly, I find it confusing that smaller/larger exist when they are the same value as small/large.

Suggested improvement

  • Add a table or paragraph describing allowable relative font size strings and their scaling factor. They are defined here:
    font_scalings = {
    'xx-small': 0.579,
    'x-small': 0.694,
    'small': 0.833,
    'medium': 1.0,
    'large': 1.200,
    'x-large': 1.440,
    'xx-large': 1.728,
    'larger': 1.2,
    'smaller': 0.833,
    None: 1.0,
    }
  • Deprecate smaller/larger in favor of small/large. It seems that they are a relic from pre-2007 when they were the only two supported relative sizes (see ac5f198).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions