Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

'mathtext.fontset' is only available as an rcParam, should be carried along with text object #7107

Closed
Labels
Milestone
@FaustinCarter

Description

@FaustinCarter

Matplotlib version 1.5.1
Installed via Anaconda

Issue: When formatting labels (or any text object), one may specify afontdict dictionary of options. Thisfontdict supersedes the rcParams and ensures that the text object is always rendered correctly. However, if the text object includes math between dollar signs (i.e.'$a=5$') and thematplotlib.mathtext.Parser is used to render the math, the font-face for the rendered math is specifiable only in the rcParams. This makes it impossible to specify an explicit font face for math within a text object, as whenever that object renders, the math font will always be set by the'mathtext.fontset' rcParam. This is especially problematic when using matplotlib in interactive mode (i.e. IPython), as every time the text object is rendered, the math font face will change appearance based on the current rcParam value, but all of the other font attributes will continue to be set by the associatedfontdict.

This may not seem like a big deal, but imagine a developer releases a function to a user that returns a figure object with math in the labels. The developer has chosen to use a sans-serif face for the math, and so changes the rcParams (as this is currently the only handle). Now any future plots the user generates during that interactive session (or in the same script) will silently use the modified rcParam, rather than the users' chosen default, contrary to expectations.

Suggested fix: add amathdict arg to text objects, which would be analogous to thefontdict arg, but for all the mathtext rcParams, and pass that to the mathtext parser.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp