Comic neue ttf4/12/2023 ![]() To request other individual styles, such as specific weights,Īppend a colon (:) after the name of the font family, followed by a list of axis Without style specifications, the API provides the default style of the So I have remove the font files for "Arial" and keep those "Arial Narrow" files, so I can use "Arial Narrow" font.Making the Web Beautiful! Individual styles, such as weight I tried to place both Arial and Arial Narrow font into the folder, but both of them appeared to use "Arial" as their name in this json file. There is also tricky part here that I don't know how to resolve yet. Interestingly, if you find the following json within the file "fontlist-v330.json" that means you can start using the font (in my case Roboto). In fact, i tried the above because I can't find a cache folder C:\Users\\ as mentioned in this thread. The last thing I tried that made me successful is to remove the file fontlist-v330.json at folder (replace C:\Users\User\ with you own folder): I have placed Roboto font at folder (replace with your Python package folder):Ĭ:\Python\Python310\Lib\site-packages\matplotlib\mpl-data\fonts\ttf\ But without modifying it, the new fonts also work.įor me, using Pycharm on Windows 10, none of the above completely solve my problem. There is a configuration file /./python3.7/site-packages/matplotlib/mpl-data/matplotlibrc on which one can add font.sans-serif fonts. Why apt-file list msttcorefonts returns nothing? apt-file list msttcorefonts returns nothing. Neither do I know what has been installed by that package. I tried sudo apt install msttcorefonts -qq but I don't think that works. You might need to restart the notebook/kernel in step 2 and 3. The font cache is per-user base( /home//.cache/matplotlib/), so other people might need to rebuild the cache too. ~/.cache/matplotlib/ ( AttributeError: module 'matplotlib' has no attribute 'font_manager'). Here's how I install new fonts and get new fonts worked( No need to restart the Jupyter container ):Īll operations are executed inside the container.ĭownload the fonts to /./python3.7/site-packages/matplotlib/mpl-data/fonts/ttf My situation is that I have JupyterHub running in Docker and I need to use matplotlib to plot and display some Chinese characters as titles. Only has 40 fonts in it of the type: DejaVuSerif,DejaVuSans,STIX,cmb, cmt, cmyĪny idea what could be going on and how I can add additional fonts? Thanks! Path_to_miniconda/miniconda3/envs/conda34/lib/python3.4/site-packages/matplotlib/mpl-data/fonts/ttf/ Have no effect, I get the same error as above. ![]() ![]() ![]() I would like to be able to use a Times New Roman font but even after deleting the Font cache file (fontList.p圓k.cache) which I find from here: import matplotlib as mpl ![]() Packages/matplotlib/font_manager.py:1297: UserWarning: findfont: Font family I get an error message: path_to_miniconda/miniconda3/envs/conda34/lib/python3.4/site. If I do a basic command such as: import matplotlib.pyplot as plt I am generally executing python code through an ipython notebook. I am working on a unix scientific computing cluster where I don't have root privileges. I am using matplotlib version 2.0.0 on Python 3 in a miniconda virtual environment. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |