1 参考
https://zhuanlan.zhihu.com/p/24952180
2 轴线中文乱码和正负号错误
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif'] = ['SimHei'] #用来正常显示中文标签
plt.rcParams['axes.unicode_minus'] = False #用来正常显示负号
3 基础画图
x = [1, 2, 3, 4, 5]# Make an array of x values
y = [1, 4, 9, 16, 25]# Make an array of y values for each x value
pl.plot(x, y)# use pylab to plot x and y
pl.show()# show the plot on the screen
4 设置轴线名称
plt.xlabel(u'方差 *10^(-3)', fontproperties='SimHei')
plt.ylabel(u'概率/%', fontproperties='SimHei') # 如果没有使用上述中文乱码解决方案,也可以用这个
5 设置多条曲线
plt.plot(x1, y1, 'x++', label="合成语音")
plt.plot(x2, y2, 'r--', label="自然语音")
plt.legend(loc='upper right')
最后编辑于 :2017.12.11 05:08:52
©著作权归作者所有,转载或内容合作请联系作者 【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。 平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。