matplotlib 字体改为 Times New Roman
来源:互联网 发布:有淘宝账号怎么贷款 编辑:程序博客网 时间:2024/05/21 17:33
测试环境:ubuntu 16.04 ,python2.7
将全局字体改为Times New Roman:
import matplotlib.pyplot as pltplt.rc('font',family='Times New Roman')
如果出现类似如下错误:
apps/rhel6/Python-2.7.2/lib/python2.7/site-packages/matplotlib/font_manager.py:1224: UserWarning: findfont: Font family ['Playfair Display'] not found. Falling back to Bitstream Vera Sans(prop.get_family(), self.defaultFamily[fontext]))
则需要删除fontList.cache 文件。这个文件有点不好找。
用如下命令获得目录:
import matplotlib as pltplt.get_cachedir()
然后进去删除fontList.cache就可以了!
参考:
http://www.himpactwxlab.com/home/how-to-wiki/change-matplotlib-fonts
https://matplotlib.org/faq/troubleshooting_faq.html
0 0
- matplotlib 字体改为 Times New Roman
- Times New Roman字体的历史
- Times New Roman字体的历史
- 快速替换字母、数字为Times New Roman字体
- IEEE论文检测的字体未嵌入问题Times New Roman,Bold, Times New Roman,Italic is not embedded解决方法
- 如何将论文中的所有字母和数字改为Times New Roman
- 如何批量修改word中宋体英文改成Times NEW Roman字体(word 2010)
- word中插入罗马数字并且设置为Times New Roman字体
- times new roman 宋体混合如何设置
- Adobe AcrobatDistiller 字体错误“Times-Roman not found. Font cannot
- Word中中文输入为宋体,英文输入为Times New Roman实现自动切换
- WORD 数字和英文换times New Roman的方法,一步搞定
- CentOS7—Fedora23—Install times new roman font—MS fonts
- (OK) Fedora23—Install times new roman font—MS fonts
- itext 微软雅黑 西罗马 Times New Roman ttf下载
- Matlab fig文件另存为的eps图片 Helvetica Times-Roman字体不能嵌入
- eclipse 3.7 默认字体 改为 courier new 方法
- 将word中所有字母和数字改为Time New Roman格式
- 校验身份证号码
- 禁止cookie,session还能继续作用
- 字节,字符及占用内存大小情况
- 基于STM32的rosserial_client的节点开发
- 创建淘宝网店
- matplotlib 字体改为 Times New Roman
- poj 1189 钉子和小球
- Android ListView 按字母排序要求每个拼音内部子类按字母在上,汉字在下再排序
- Linux(Centos 7)安装JDK并配置环境变量
- Android中使用am命令实现在命令行启动程序详解
- maven 用指令启动jetty或tomcat需要做的步骤
- MYSQL 双向配置
- 多层嵌套json解析与构建|vuejs初探
- KNN算法工作原理及实现