Skip to content

Can't specify integer font.weight in custom style sheet any more #15240

Closed
@fpavogt

Description

@fpavogt

Bug report

In matplotlib v3.1.1, the font_manager.FontManager.score_weight function was made more robust, and now issues an exception if a integer value is passed as a string (e.g. '500').

This, however, causes havoc with my custom style sheet, in which I define font.weight: 500, which then appears to be converted to '500' by the time it reaches the score_weight function.

Expected outcome

Specifying font.weight: 500 used to work in earlier versions. The doc still suggests (indirectly) that this should work.

Question
What is the proper way to specify integer font weights in style sheets ? Should they be banned (and the doc clarified) in favor of name-based strings (e.g. normal) ? Or the score_weight function modified to handle them?

Matplotlib version

  • Operating system: OS X 10.13.6
  • Matplotlib version: 3.1.1
  • Python version: 3.7.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions