-
-
Notifications
You must be signed in to change notification settings - Fork 360
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
Font family [u'Helvetica'] not found
with PyPlot backend
#593
Comments
I get this warning constantly and I've tried several times to figure out the source of the issue and every time I fail. I don't have time to spend on this, so help is greatly appreciated! |
Understood. Can you point to any information about how to go about debugging this? I've struggled to follow the code path which is why I stopped where I did. |
I have the same problem on Linux. The Problem (part A) The reason for this message is quite simple:
... But this lists the file path/names of supported fonts. File paths only hint to what might be acceptable font
On my system, the family name is called "DejaVu Sans". You can see that
If you run the above using The Problem (part B) @anowacki: Temporary Solution 1
... As long as you remember to restore the file before your next Temporary Solution 2
Suggested solution
... But even this is a bit annoying to do for every new Julia session. I personally like it when my module can read in its defaults from a variable that can be defined in the
|
This is closely related to #555. The solution would be handled similar to background/foreground colors... |
Rather than specifying a specific typeface, set the font *family* in the `family` field of `Font` as `sans-serif` by default. Fixes JuliaPlots#593.
Rather than specifying a specific typeface, set the font *family* in the `family` field of `Font` as `sans-serif` by default. Fixes JuliaPlots#593.
Thanks, @ma-laforge, for the detective work. If I may summarise, this arises because Plots is using the
I've just submitted PR #635 to set this value to Also tested with GR and PlotlyJS backends to check they don't complain, which they seem not to. |
No problem @anowacki. Note, however, that it is not wrong to specify the Although I do agree that it is probably a better idea to request a generic font family, like For one: some of the backends might not recognize these names: Technically, they are not real font family names - they are simply aliases. (Side note: it is possible that all backends supported by Plots.jl are ok with these aliases, though). I personally have noticed issues with the default font families using Cairo in Windows 7: ...So, at the end of the day: I still believe there should be a mechanism for the user to overwrite the default font family name. |
There's always been many ways to override defaults. Read the docs. You can
add overrides to your juliarc.jl file. I'm traveling and can't give an
exact link right now.
…On Sun, Jan 8, 2017 at 10:48 AM ma-laforge ***@***.***> wrote:
No problem @anowacki <https://github.com/anowacki>.
Note, however, that it is not wrong to specify the family name as
"Helvetica" (it appears that family is the proper designation for font
name). The problem is simply that this font does not appear to be
installed - or at least cannot be located by the font manager.
Although I do agree that it is probably a better idea to request a generic
font family, like sans-serif, this is only a partial fix.
For one: some of the backends might not recognize these names:
Technically, they are not real font family names - they are simply aliases.
(Side note: it is possible that all backends supported by Plots.jl are ok
with these aliases, though).
I personally have noticed issues with the default font families using
Cairo in Windows 7:
JuliaGraphics/Cairo.jl#138
<JuliaGraphics/Cairo.jl#138>
...So, at the end of the day: I still believe there should be a mechanism
for the user to overwrite the default font family name.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#593 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA492qlybRtEYNwFR3Hcj76hUnud1T1Mks5rQQU6gaJpZM4K_HYX>
.
|
Use `sans-serif` as default font family (fix #593)
When using PyPlot, on my system (OS X 10.11, Julia v0.5.0) I always get the following:
This is regardless of whether I use Python and Matplotlib from MacPorts, or after installing it locally with Conda.jl (via
ENV["PYTHON"]=""; Pkg.build("PyPlot")
).I believe this occurs because the default font set by Plots.jl is Helvetica (in
src/components.jl:242
?), but PyPlot cannot find it. This is curious, though, because PyPlot on its own has no problem using Helvetica when set in~/.matplotlib/matplotlibrc
and called separately:I can confirm that PyPlot is reading this file for defaults:
and that it's also true when using Plots:
Note that deleting
~/.matplotlib
and trying the first command also causes problems, hence my suspicion that it is the way that Plots is setting the default font which causes issues.Please let me know what else might help fix the issue. Having to use Bitstream Vera Sans is one of the few impediments to using Plots.jl in publications right now!
The text was updated successfully, but these errors were encountered: