0

I'm using matplotlib to draw pi-chart jupyter notebook(python 3.5) on Watson Studio . Data for the chart contain Korean. It causes broken font because Korean font is not installed on the server where Watson Studio is running.

Platform, System information are as follows:

Platform and System information image

and pi-chart output:

pi-chart output image

How can I install font for Jupyter notebook on Watson Studio ?

Rohan Nadagouda
  • 462
  • 7
  • 18
  • 2
    There's an earlier question that's very similar to yours. They [resolved it](https://stackoverflow.com/a/48402923/425458) by first installing the font, then deleting Matplotlib's font cache (it rebuilds itself automatically). You can follow the instructions there to do so. – tel Dec 17 '18 at 06:57
  • @tel I'm using Jupyter notebook on Watson Studio. IBM Watson Studio is a cloud service. I can't connect to server shell. – Daehyun Ryu Dec 18 '18 at 07:21
  • You'll have to ask the support staff for the cloud service to fix the issue for you. There's not much anyone here can help you with directly if you can't actually access a shell. – tel Dec 18 '18 at 07:23
  • That being said, you should have at least some access to the underlying server via the builtin `IPython` commands (such as `ls` and `cd`) and the `%%bash` cell magic. Maybe you can get access to the font files that way? – tel Dec 18 '18 at 07:25
  • @tel I agree with you. I'd rather ask the support team. I tried `%%bash` as well. But I don't have permission necessary to install fonts – Daehyun Ryu Dec 19 '18 at 01:26

1 Answers1

0

I found a workaround. tel's idea helps me. Thanks tel.

First, I downloaded font and unzipped it.

%%bash
wget http://cdn.naver.com/naver/NanumFont/fontfiles/NanumFont_TTF_ALL.zip
unzip NanumFont_TTF_ALL.zip -d NanumFont
ls -al

And I made the font as a default font family for matplotlib

import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.font_manager as fm

fm.fontManager.ttflist.extend(font_list)
mpl.rcParams.update({'font.size': 15,
                        'font.family': 'NanumGothic'})

And it works!!!