When I tried to display Japanese in the graph, the characters became garbled and I was quite addicted to it, so as a memorandum.
When using a virtual environment with Anaconda, it will be reset to "Every environment".
Characters are garbled with the display of missing from current font.
The font used to eliminate garbled characters may be
MS Gothic, but it seems that the license-free font ʻIPAex Gothic
, which can also be used on Linux, is often used. In some past reference articles, past fonts such as ʻIPAP Gothic were used, so I was addicted to writing with reference to that.
Copy ttf file to the following folder
C: \ Users \ [your account] \ Anaconda3 \ envs \ [virtual environment name you want to use] \ Lib \ site-packages \ matplotlib \ mpl-data \ fonts \ ttf
matplotlibrc file in the following folder with Notepad etc.
C: \ Users \ [your account] \ Anaconda3 \ envs \ [virtual environment name you want to use] \ Lib \ site-packages \ matplotlib \ mpl-data
Around line 250
to # font.family :. (It seems that the defaultsans-serif` can be deleted.) Also, change the name as appropriate depending on the font used.
C: \ Users \ [your account] \ .matplotlibto the Trash
Reboot the virtual environment
The garbled characters have been successfully resolved.