-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Default ScalarFormatter ignores usetex font setting #8436
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I've found the culprit for this behavior, after struggling with the problem myself for quite some time. In the file ticker.py and the class ScalarFormatter, there is a method _set_format(). This method checks if tex is used and formats accordingly: |
This means that another possible option would be to turn off the
Complete example:
|
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help! |
The default ScalarFormatter for axes ignores font setting when used with
usetex = True
.Consider the following example, where we use latex and set the font-family to 'sans-serif':
resulting in this image:

As can be seen, the axis labels are in sans-serif font. However, the ticklabels are unexpectedly still in serif font.
The reason seems to be the ScalarFormatter in use. If we change the formatter to e.g. a
StrMethodFormatter
, we get the expected result:Since the use of a ScalarFormatter is desirable for many applications, I think this should be fixed.
The text was updated successfully, but these errors were encountered: