[PYTHON] Easy Japanese font setting with matplotlib

I could set it by checking from the list and editing the file a little without downloading.



$ uname -a
Linux debian 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u1 (2017-06-18) x86_64 GNU/Linux
$ cat /etc/debian_version
$ python3 --version
Python 3.5.3
$ python3 -c "import matplotlib; print(matplotlib.__version__)"



$ python3 -c "import matplotlib as mpl; print(mpl.matplotlib_fname())"
$ python3 -c "import matplotlib.font_manager; print([f.name for f in matplotlib.font_manager.fontManager.ttflist])" | grep  --color=auto -i gothic
['STIXGeneral', ... , 'IPAGothic',  ...  'MathJax_SansSerif']

The text you're looking for is highlighted in color so you can easily find it.

Edit configuration file

$ sudo vim /etc/matplotlib

Replace with font.family: IPAGothic.

Recommended Posts

Easy Japanese font setting with matplotlib
Japanese with matplotlib
[Python] font family and font with matplotlib
Draw Japanese with matplotlib on Ubuntu
Easy to draw graphs with matplotlib
Easy animation with matplotlib (mp4, gif)
Display Japanese graphs with VS Code + matplotlib
[Python] Let's make matplotlib compatible with Japanese
python Environmentally-friendly Japanese setting
tesseract-OCR for Python [Japanese version]
Easy Japanese font setting with matplotlib
Pclinuxos64-kde5 Japanese setting
Animation with matplotlib
Animation with matplotlib
Histogram with matplotlib
Animate with matplotlib
Increase the font size of the graph with matplotlib
Easy Grad-CAM with pytorch-gradcam
2-axis plot with Matplotlib
Japanese input with pyautogui
Heatmap with Python + matplotlib
Band graph with matplotlib
Speaking Japanese with OpenJtalk
Learn with Cheminformatics Matplotlib
Real-time drawing with matplotlib
Various colorbars with Matplotlib
3D plot with matplotlib
python Environmentally-friendly Japanese setting
Easy debugging with ipdb
Adjust axes with matplotlib
Easy TopView with OpenCV
Create SVG graph with matplotlib on heroku (displayed in Japanese)
Send Japanese email with Python3
Graph Excel data with matplotlib (1)
Easy tox environment with Jenkins
[Seaborn] Display Japanese (change font)
[Co-occurrence analysis] Easy co-occurrence analysis with Python! [Python]
Try using matplotlib with PyCharm
Japanese localization setting of PyCharm
Set matplotlib font on ubuntu
Graph drawing method with matplotlib
Easy folder synchronization with Python
Easy to make with syntax
Easy image classification with TensorFlow
Graph Excel data with matplotlib (2)
Easy web scraping with Scrapy
Stackable bar plot with matplotlib
Easy Python compilation with NUITKA-Utilities
Easy HTTP server with Python
Easy proxy login with django-hijack
Gradient color selection with matplotlib
Animate multiple graphs with matplotlib