Every time I use jupyter in various environments, I feel that I am suffering from the problem of garbled Japanese characters. This time there was no solution for Don Pisha, so I will record it.
Resolve garbled Japanese characters in matplotlib of Jupyter Notebook on Docker. (Proceed by adding to the Dockerfile.)
Confirmed on jupyter.
import matplotlib.font_manager as fm
fm.findSystemFonts()
['/ File storage PATH / Somehow .ttf', You should see something like'/ file storage PATH / something .ttf']. (Use in 3)
Download "IPAex Gothic" from IPAex Font. Put ipaexg.ttf in the same directory as Dockerfile.
Added to Dockerfile.
COPY ipaexg.ttf /File storage PATH (check with 1)/
Confirmed on jupyter.
import matplotlib
matplotlib.matplotlib_fname()
You should see something like'/ settings storage PATH / matplotlib / matplotlibrc'. (Use in 5)
Added to Dockerfile.
RUN echo 'font.family : IPAexGothic' >> /Setting storage PATH/matplotlib/matplotlibrc
Confirmed on jupyter.
import matplotlib as mpl
mpl.get_configdir()
You should see something like'/ cache PATH / .cache / matplotlib'. (Used in 6)
!rm -r /Cache storage PATH/.cache/matplotlib
Recommended Posts