Monday, 2 September 2019

Fonts in Matplotlibrc

I would appreciate any insights into an issue I'm having.

I have recently downloaded python 3 onto my MacBook Pro. I have a sample python script in which I am plotting a few curves, and try to run this script using python 3 from the terminal command line. Before running the script from the command line, I have made some changes to the matplotlibrc file which controls the look of plots.

Specifically, I've set the font.family choice in the matplotlibrc file to sans-serif by writing font.family : sans-serif. The reason I have this is because I would like the Avant Garde font, so in the file I have also font.sans-serif : Avant Garde.

However, when I run the script from the terminal command line using python3 script.py I get the following error message:

findfont: Font family ['sans-serif'] not found. Falling back to DejaVu Sans.
findfont: Font family ['sans-serif'] not found. Falling back to DejaVu Sans.
findfont: Font family ['sans'] not found. Falling back to DejaVu Sans.
findfont: Font family ['sans'] not found. Falling back to DejaVu Sans.
findfont: Font family ['sans'] not found. Falling back to DejaVu Sans.

So the resulting plot does not display words in the sans-serif, Avant Garde font.

I've tried using pip3 install fonts in the terminal command line, but this doesn't help.

I would appreciate any help.



from Fonts in Matplotlibrc

No comments:

Post a Comment