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
LaTeX axis labels can no longer have custom fonts #6514
Comments
Spent a little bit of time digging into matplotlib internals. It's easiest to see a difference by looking at the Under matplotlib 1.5.1, the call to
While on matplotlib 2.0b1, it returns a font object with the following filename:
So it looks like the real issue is that mathtext used to be rendered in a serif computer modern font by default, but now defaults to a sans-serif DejaVuSans font. Is there a way to modify the script I linked to in the issue description to pick out the computer modern font matplotlib used to use? |
More precisely, is there a way to set the font used by matplotlib for mathtext rendering using the object-oriented interface? I don't think I can do this by setting rcparams, as suggested in the docs, since this is in the context of a library depending on matplotlib rather a user script making use of matplotlib. |
I'm going to close this and open another issue with a feature request about controlling mathtext fonts via the OO API. |
Indeed there's no way other than setting an rcParam at present. You can, however, use the rcParam context manager to change it to what you need and then automatically change it back. |
IIRC, it is possible to pass in a dictionary to the context manager rather On Wed, Jun 1, 2016 at 8:32 AM, Michael Droettboom <notifications@github.com
|
@WeatherGod: Yes. |
This happens in matplotlib 2.0b1. Here's an example that triggers this behavior:
https://gist.github.com/ngoldbaum/67cf464cc1e2763f95808759423943d9
And this is what the resulting image looks like:
Here's what the image produced by the exact same script run under matplotlib 1.5.1 looks like:
Note how in matplotlib 1.5.1 the y axis label is drawn using the font I specify in the script (stixgeneral). Under matplotlib 2.0b1, the font is unconditionally set to the default matplotlib font no matter what I do.
This underlying issue is currently causing some labels in yt plots to be rendered with the incorrect font under matplotlib 2.0b1.
The text was updated successfully, but these errors were encountered: