matplotlib中文乱码解决
来源:互联网 发布:红色后代知乎 编辑:程序博客网 时间:2024/05/22 01:35
下列程序在Python3.6下运行通过。
# -*- coding=utf-8 -*-from matplotlib import font_managerimport matplotlib.pyplot as plt;if __name__ == '__main__': thread_num = [1, 3, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100] throughput1 = [574.8695765, 878.0209408, 890.9727752, 892.219843, 890.1647918, 886.6329007, 884.769794, 882.6222708, 880.9602467, 877.2218384, 875.8964252, 875.2639468, 874.2978296] throughput2 = [18.22837677, 52.29950462, 88.11752763, 161.328, 235.0830, 233.0830, 231.0830, 229.0830, 227.0830, 225.0830, 223.0830, 221.0830, 219.0830062] # 指定字体为微软雅黑 zh_font = font_manager.FontProperties(fname=r'c:\windows\fonts\msyh.ttc', size=11) # Plot the figure. line, = plt.plot(thread_num, throughput1, color='cornflowerblue', linestyle='-', linewidth=3, marker='o', markersize=8, label='大对象') plt.plot(thread_num, throughput2, color='darkred', linestyle='-', marker='s', markersize=8, linewidth=3, label='小对象') plt.ylim(ymin=0) plt.ylabel('平均吞吐率(Mbit/s)', fontproperties=zh_font) plt.legend(loc=(0.78, 0.8), prop=zh_font) plt.xlabel('线程数', fontproperties=zh_font) plt.savefig('TestConcurrentPut10Mand10K.png') plt.show()
阅读全文
0 0
- matplotlib中文乱码解决
- 解决matplotlib中文乱码问题
- 解决matplotlib中文乱码问题
- matplotlib解决中文乱码问题
- matplotlib解决中文乱码问题
- 解决matplotlib中文乱码问题(Windows)
- python matplotlib中文显示乱码解决
- 解决matplotlib中文乱码问题(Windows)
- 解决matplotlib中文乱码问题(Windows)
- matplotlib中文乱码解决方法
- matplotlib中文乱码解决方法
- Python Matplotlib 中文乱码
- matplotlib图例中文乱码
- Matplotlib中文乱码解决方案
- 解决matplotlib中文乱码问题(Ubuntu16.04)
- Python3下使用matplotlib画图添加中文注释乱码解决
- Ubuntu下matplotlib绘图中文乱码问题的解决
- 彻底解决matplotlib中文乱码问题
- 引用图片防盗链js
- vba 64位office Excel不用ActiveX ScriptControl转换为UTF8
- Excel 导出
- 《android framework常用api源码分析》之IntentService意图服务
- 完美测试-软件测试系列最佳实践[电子工业出版社].pdf
- matplotlib中文乱码解决
- python一些关于字符串的知识
- SMTP的几个端口的比较
- TCP与UDP区别
- 1.1 图像分类:数据驱动的方法,k-近邻,划分训练集/验证集/测试集
- 明德扬FPGA-培训班公开课-第09期-《FIFO的使用技巧》
- 【八中】区间覆盖问题
- python+selenium初级(1)—控制浏览器
- TableviewCell高度自适应