博客
关于我
python画曲线图
阅读量:516 次
发布时间:2019-03-07

本文共 3714 字,大约阅读时间需要 12 分钟。

直接给出代码作为backup

# -*- coding: utf-8 -*-import matplotlib.pyplot as pltimport numpy as npfrom scipy import interpolateplt.figure(figsize=(10,5),dpi=300)ax = plt.subplot(111)# plt.figure()###############parameter# # y_baseline = [25.6275,25.8021, 25.9870, 26.1279]# y_baseline=[30.1719,30.2677,30.3770,30.4662]# para_baseline = [0.557,0.705, 1.0000, 1.5910]# para_multiscale = [0.706, 1.0020, 1.5940,1.890,2.334]# # y_multiscale = [25.6503, 25.8278, 25.9952,26.0790,26.1276]# y_multiscale=[30.2677 ,30.2892, 30.3790,30.4238,30.4874]# para_dir = [0.539, 0.760, 1.2040,1.426, 1.648, 1.870]# # y_dir = [25.5985, 25.7573, 25.9703,26.0137,26.0823,26.0912]# y_dir=[30.1619,30.2626,30.3787,30.4200,30.4499,30.4613] # # para_cro = [0.539, 0.760, 1.2040,1.426,1.759,1.870]# # y_cro = [25.6110, 25.7573, 25.9836,26.0324,26.0970,26.1270]# para_dir2 = [0.244, 0.334, 0.5160,0.653,0.789,0.925,1.062,1.152]# # y_dir2 = [25.4738, 25.6644, 25.8408,25.9463,26.0244,26.0404,26.0385,26.0863]# y_dir2=[30.0669,30.1935,30.3030,30.3698,30.3934,30.4336,30.4348,30.4535]# # para_cro2 = [0.391, 0.547, 0.860]# # y_cro2 = [25.5194, 25.7108, 25.9080]# plt.plot(para_baseline,y_baseline,label='Standard Conv') # plt.plot(para_multiscale, y_multiscale, label = 'Multi-scale Conv', color = '#FFA500')# plt.plot(para_dir, y_dir, label = 'MS^2-Conv(3*3)', color = 'g')# # plt.plot(para_cro, y_cro, label = 'cross share', color = 'r')# plt.plot(para_dir2, y_dir2, label = 'MS^2-Conv', color = '#800080')# # plt.plot(para_cro2, y_cro2, label = 'cross 1*1', color = '#A52A2A')# plt.legend(loc="lower right")# plt.grid(linewidth=1.0)# ax.spines['top'].set_visible(False)# ax.spines['right'].set_visible(False)# plt.xlabel('Para. (M)',size=15)# # plt.show()# plt.ylim(30, 30.6)# # plt.xlim(0, 3)# plt.savefig('123.pdf',bbox_inches='tight')         # # plt.figure()FLO_b = [25.848,28.2640, 33.0960, 42.7590]# y_b = [25.6275,25.8021, 25.9870, 26.1279]y_b =[30.1719,30.2677,30.3770,30.4662]FLO_m = [16.5510, 20.7790,22.893,26.064]# y_m = [25.6503, 25.8278, 25.9952,26.0790,26.1276]y_m =[30.2892, 30.3790,30.4238,30.4874]FLO_ds = [14.4377, 16.5510, 20.7790,22.893,25.007,27.121]# y_ds =  [25.5985, 25.7573, 25.9703,26.0137,26.0823,26.0912]y_ds=[30.1619,30.2626,30.3787,30.4200,30.4499,30.4613] # FLO_cs = [14.4377, 16.5510, 20.7790,22.893,26.064,27.121]# y_cs = [25.6110, 25.7573, 25.9836,26.0324,26.0970,26.1270]FLO_d2 = [12.4240, 14.0010, 17.1550,19.521,21.886,24.252,28.195]############ y_d2 =  [25.4738, 25.6644, 25.8408,25.9463,26.0244,26.0404,26.0863]y_d2=[30.0669,30.1935,30.3030,30.3698,30.3934,30.4336,30.4535]for i in range(0,len(FLO_b)):    plt.scatter(FLO_b[i], y_b[i], marker='D', s=30, color="#1E90FF")for i in range(0,len(FLO_m)):    plt.scatter(FLO_m[i], y_m[i], marker='D', s=30, color="#FFA500", )for i in range(0,len(FLO_ds)):    plt.scatter(FLO_ds[i], y_ds[i], marker='D', s=30, color="g", )for i in range(0,len(FLO_d2)):    plt.scatter(FLO_d2[i], y_d2[i], marker='D', s=30, color="#800080", )# FLO_cs2 = [12.4240, 14.0010, 17.1550]# y_cs2 = [25.5194, 25.7108, 25.9080]plt.plot(FLO_b, y_b,  linewidth=2,label = 'Standard Conv',color="#1E90FF")plt.plot(FLO_m, y_m,  linewidth=2,label = 'Multi-scale Conv', color = '#FFA500')plt.plot(FLO_ds, y_ds,  linewidth=2,label = 'MS²-Conv(3*3)', color = 'g')# plt.plot(FLO_cs, y_cs, label = 'cross share', color = 'r')plt.plot(FLO_d2, y_d2,  linewidth=2,label = 'MS²-Conv', color = '#800080')# plt.plot(FLO_cs2, y_cs2, label = 'cross 1*1', color = '#A52A2A')plt.legend(loc="lower right")plt.grid(linewidth=1.0,linestyle='--')ax.spines['top'].set_visible(False)ax.spines['right'].set_visible(False)plt.xlabel('FLOPs (G)',size=15)# plt.show()plt.ylim(30, 30.6)plt.savefig('456.pdf',bbox_inches='tight')

 

转载地址:http://lyajz.baihongyu.com/

你可能感兴趣的文章
mysql5.6.21重置数据库的root密码
查看>>
Mysql5.6主从复制-基于binlog
查看>>
MySQL5.6忘记root密码(win平台)
查看>>
MySQL5.6的Linux安装shell脚本之二进制安装(一)
查看>>
MySQL5.6的zip包安装教程
查看>>
mysql5.7 for windows_MySQL 5.7 for Windows 解压缩版配置安装
查看>>
Webpack 基本环境搭建
查看>>
mysql5.7 安装版 表不能输入汉字解决方案
查看>>
MySQL5.7.18主从复制搭建(一主一从)
查看>>
MySQL5.7.19-win64安装启动
查看>>
mysql5.7.19安装图解_mysql5.7.19 winx64解压缩版安装配置教程
查看>>
MySQL5.7.37windows解压版的安装使用
查看>>
mysql5.7免费下载地址
查看>>
mysql5.7命令总结
查看>>
mysql5.7安装
查看>>
mysql5.7性能调优my.ini
查看>>
MySQL5.7新增Performance Schema表
查看>>
Mysql5.7深入学习 1.MySQL 5.7 中的新增功能
查看>>
Webpack 之 basic chunk graph
查看>>
Mysql5.7版本单机版my.cnf配置文件
查看>>