苹果IOS matplotlib绘图中文显示

苹果电脑找不到simhei字体,matplotlib绘图会乱码,可以用以下代码解决。

import matplotlib.pyplot as plt
plt.rcParams['axes.unicode_minus'] = False
from matplotlib.font_manager import FontManager
fm = FontManager()
fonts = set(f.name for f in fm.ttflist)
plt.rcParams["font.sans-serif"] = ["Arial Unicode MS"]
赞(0)
版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权,转载请注明出处。
文章名称:《苹果IOS matplotlib绘图中文显示》
文章来自:泰恩数据
文章链接:https://tyne.cc/1073.html
本站资源仅供个人学习使用,请勿用于商业用途。

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址