用matplotlib画图时,给图像标题、横纵坐标轴的标签、图例显示中文名字
2019-05-27 11:38
2081 查看
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
font = FontProperties(fname=r"c:\windows\fonts\SimSun.ttc", size=14)
plt.title(u"各等级的乘客年龄分布", fontproperties=font)
plt.xlabel(u"年龄", fontproperties=font)
plt.ylabel(u"密度", fontproperties=font)
plt.legend((u’头等舱’, u’2等舱’,u’3等舱’,),loc=‘best’, prop=font)
相关文章推荐
- matplotlib画图标签显示中文问题
- matplotlib中文坐标轴和标题显示
- matplotlib画图标签显示中文问题
- matplotlib绘图之中文标题、坐标轴标签乱码问题
- Python_matplotlib画图时图例说明(legend)放到图像外侧
- matplotlib图例中文显示问题
- Python matplotlib画图的中文显示问题
- python中matplotlib画图中文不能显示
- 基于Linux系统中python matplotlib画图的中文显示问题的解决方法
- Python使用matplotlib模块绘制图像并设置标题与坐标轴等信息示例
- 解决Linux系统中python matplotlib画图的中文显示问题
- python画图matplotlib的Legend(显示图中的标签)
- matplotlib基础——令画图时显示中文的方法
- python matplotlib.plot画图显示中文乱码的问题
- matplotlib画图中文显示问题
- python的matplotlib画图时无法显示中文的解决方法
- matplotlib中文显示坐标--修改matplotlibrc文件(for windows系统)
- Python 3下Matplotlib画图中文显示乱码的解决方法
- 用matplotlib设置标题、轴标签、刻度标签以及添加图例
- python画图包seaborn和matplotlib中文字体显示(针对windows系统,,使用ipython notebook)