Matplotlib在Jupyter Notebook上的Watson Studio上的打破字体

2024-10-02 10:21:53 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用matplotlib在watstonstudio上绘制pi图表jupyter笔记本(python3.5)。图表数据包含朝鲜语。它会导致字体损坏,因为运行Watson Studio的服务器上没有安装韩文字体。你知道吗

平台,系统信息如下:

Platform and System information image

和pi图输出:

pi-chart output image

如何在Watson Studio上安装Jupyter笔记本的字体?你知道吗


Tags: 数据服务器信息matplotlib系统图表pi绘制
1条回答
网友
1楼 · 发布于 2024-10-02 10:21:53

我找到了解决办法。泰尔的想法对我有帮助。谢谢电话

首先,我下载字体并解压缩。你知道吗

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

我将该字体作为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'})

而且很有效!!!你知道吗

相关问题 更多 >

    热门问题