-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
How to set multiple default fonts with matplotlib? #3010
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 think the problem you are running into is solved by #2771 -- which has stalled out because we're having trouble getting the test suite to pass on Travis with those changes. We'll need to devote a few cycles to getting that resolved -- but you could try using that patch locally if you want it today. |
So I'm a little confused, is this is a bug just on 1.3.1, or on anything <= 1.3.1? I'm trying to figure out the best way to work around this in seaborn. |
I think it was introduced in 1.3.0 and will be fixed in the next release. |
Is there an ETA on 1.4? And will there be a 1.3.x bugfix release? |
'soon' for 1.4 and probably not on 1.3.2. |
@mwaskom Can you confirm that this is fixed for you an master? |
I am unable to build matplotlib on my laptop :(
Apparently I have freetype 2.4.10 installed, according to conda. |
Does this PR help? #3032 |
Well, with that I can install matplotlib but not import it
|
I guess that is progress? @maciejkula can you take a look at this? iirc @efiring is a mac user. Do we have a local anaconda expert? |
Offhand, it seems like the problem is related overwriting the Anaconda matplotlib with the one you are building with pip. I think I would try to restore a clean Anaconda, and then build and install in some other location. I suppose a virtualenv could be used for this, or maybe the --user option to pip install. That's just a rough outline; I don't know what the best method would be in detail. |
The example in the first post should be sufficient to test for anyone who has Arial (or Liberation Sans) installed and is using master.
|
Closing this as that example works correctly for me on current master. |
I asked this as a SO question that didn't seem to get any responses.
I don't think this is a bug, but it feels like a bug because I don't understand it :). Feel free to close this and answer over there if you think it is just a misunderstanding.
I want to set the default matplotlib fonts through the rc parameters in a way that is portable to computers that might not have the same set of fonts available.
Here is what I thought would work:
Because I have Arial installed on my system, I thought that the xlabel would be in Arial. But this approach should mean the default for someone who doesn't have Arial but does have Liberation Sans (i.e. a default Ubuntu system) will be Liberation Sans. And then it should fall back to Bitstream Vera Sans as the default when neither of the two alternate choices are available.
However, this is not what happens. If I do
print ax.xaxis.label.get_fontname()
it reportsBitstream Vera Sans
. Again, I have Arial installed. In other words, I can then doand get
Arial
.It feels like I am missing something fundamental about the relationship between the
font.family
rc parameter and thefont.sans-serif
parameter when family is "sans serif".The text was updated successfully, but these errors were encountered: