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

Get Mathtext\times symbol fromcmsy10 when usingcmr10.#23702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
timhoffm merged 2 commits intomatplotlib:mainfromtfpf:cmr10_cmsy10_substitutions
Oct 6, 2022

Conversation

tfpf
Copy link
Contributor

PR Summary

Fixes#10029.

import matplotlib.pyplot as pltplt.rcdefaults()plt.rc('font', family=['cmr10'])plt.rc('mathtext', fontset='cm')plt.rc('axes.formatter', use_mathtext=True)plt.semilogy([-0.03, 0.05], [0.3, 0.05])plt.show()

CM_multiplication_symbol

I felt that having all glyph fixes in the same place would result in cleaner code. This will also be easy to extend if, in the future, we plan to add more glyph substitutions.

PR Checklist

Tests and Styling

  • Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (installflake8-docstrings and runflake8 --docstring-convention=all).

Documentation

  • [N/A] New features are documented, with examples if plot related.
  • [N/A] New features have an entry indoc/users/next_whats_new/ (follow instructions in README.rst there).
  • [N/A] API changes documented indoc/api/next_api_changes/ (follow instructions in README.rst there).
  • [N/A] Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).

Copy link
Member

@oscargusoscargus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

One may consider a test. but I cannot really tell what would be the simplest test as a normaltext with `\times' does already work.

@tfpf
Copy link
ContributorAuthor

I think testing this isn't straightforward, since the missing multiplication sign logs a warning, but doesn't raise a user warning. (Otherwise, something similar to#20235 could be used to detect it.)

One thing I missed:cmr10_cmsy10_substitutions should probably be private; the way it is used seems to be an implementation detail.

@anntzer
Copy link
Contributor

Perhapshttps://docs.pytest.org/en/7.1.x/how-to/logging.html#caplog-fixture can help.

tfpf reacted with thumbs up emoji

@oscargus
Copy link
Member

I was more thinking about testing that the multiplication sign shows up (instead of ¤), rather than the warning thing.

@tfpftfpfforce-pushed thecmr10_cmsy10_substitutions branch fromba3891d to077ea7cCompareAugust 22, 2022 16:35
@tfpf
Copy link
ContributorAuthor

tfpf commentedAug 22, 2022
edited
Loading

I was more thinking about testing that the multiplication sign shows up (instead of ¤), rather than the warning thing.

I think this would require an image comparison test? I could add it if required.

@tfpf
Copy link
ContributorAuthor

Strange. How did the code coverage decrease. There are no uncovered lines reported in the diff.

@oscargus
Copy link
Member

I do not really understand how that test works, but it does fail from time to time, so no worries about it. (Except for maybe people not reviewing as the build "fails" anyway...)

tfpf reacted with eyes emoji

@oscargusoscargus added this to thev3.7.0 milestoneAug 30, 2022
@tfpftfpfforce-pushed thecmr10_cmsy10_substitutions branch from48192cc tof53301dCompareOctober 4, 2022 18:11
@timhoffmtimhoffm merged commit7f758c6 intomatplotlib:mainOct 6, 2022
@tfpftfpf deleted the cmr10_cmsy10_substitutions branchOctober 6, 2022 16:03
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@timhoffmtimhoffmtimhoffm approved these changes

@oscargusoscargusoscargus approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v3.7.0
Development

Successfully merging this pull request may close these issues.

\times in minor ticklabels not recognized due to \mathdefault
4 participants
@tfpf@anntzer@oscargus@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp