[PYTHON] When Times New Roman cannot be used with matplotlib (Ubuntu)

If you get the following error:

UserWarning: findfont: Font family ['Times New Roman'] not found. Falling back to DejaVu Sans.
  (prop.get_family(), self.defaultFamily[fontext]))

The solution is to enter the following command from Terminal.

$ sudo apt install msttcorefonts -qq
$ rm ~/.cache/matplotlib -rf

For ttf-mscorefonts-installer, move the cursor to the position you want to select with Tab and press Enter.

Recommended Posts

When Times New Roman cannot be used with matplotlib (Ubuntu)
When Times New Roman cannot be used with matplotlib (Ubuntu)
[android] When AVD cannot be used with permission denied
When Html cannot be output with Jupyter Notebook
When contour map cannot be drawn with APLpy
No module named'distutils.util' cannot be used with get-pip.py
Investigation when import cannot be done with python
Python note: When the pip command cannot be used
Options when installing libraries that cannot be piped with pyenv
Solution when the image cannot be displayed with tkinter [python]
Record of actions to be taken when google_image_download cannot be used
When USB cannot be formatted
When pydub cannot be installed
[For IT beginners] What to do when the rev command cannot be used with Git Bash
Parallel computing (pathos) when dealing with objects that cannot be pickled
When matplotlib doesn't work with python2.7
The --security option cannot be used with the dnf command on CentOS Linux
The story of using mysqlclient because PyMySQL cannot be used with Django 2.2
I tried to put PyCharm in Ubuntu 16.04 LTS (PPA cannot be used)
matplotlib image cannot be renamed and saved
Python modules with "-(hyphen)" cannot be removed
Items that cannot be imported with sklearn
Be careful when running CakePHP3 with PHP7.2
[Ubuntu 18.04 LTS] What to do when the screen resolution cannot be selected [NVIDIA]
Correspondence memo when the direction key cannot be used on the python command line