matplotlib画图
matplotlib画图
import numpy as np
import matplotlib.pyplot as plt
x1=[20,33,51,79,101,121,132,145,162,182,203,219,232,243,256,270,287,310,325]
y1=[49,48,48,48,48,87,106,123,155,191,233,261,278,284,297,307,341,319,341]
x2=[31,52,73,92,101,112,126,140,153,175,186,196,215,230,240,270,288,300]
y2=[48,48,48,48,49,89,162,237,302,378,443,472,522,597,628,661,690,702]
x3=[30,50,70,90,105,114,128,137,147,159,170,180,190,200,210,230,243,259,284,297,311]
y3=[48,48,48,48,66,173,351,472,586,712,804,899,994,1094,1198,1360,1458,1578,1734,1797,1892]
x=np.arange(20,350)
l1=plt.plot(x1,y1,'r--',label='type1')
l2=plt.plot(x2,y2,'g--',label='type2')
l3=plt.plot(x3,y3,'b--',label='type3')
plt.plot(x1,y1,'ro-',x2,y2,'g+-',x3,y3,'b^-')
plt.title('The Lasers in Three Conditions')
plt.xlabel('row')
plt.ylabel('column')
plt.legend()
plt.show()
# -*- coding: UTF-8 -*-
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt #这里导入你自己的数据
#......
#......
#x_axix,train_pn_dis这些都是长度相同的list() #开始画图
sub_axix = filter(lambda x:x%200 == 0, x_axix)
plt.title('Result Analysis')
plt.plot(x_axix, train_acys, color='green', label='training accuracy')
plt.plot(sub_axix, test_acys, color='red', label='testing accuracy')
plt.plot(x_axix, train_pn_dis, color='skyblue', label='PN distance')
plt.plot(x_axix, thresholds, color='blue', label='threshold')
plt.legend() # 显示图例 plt.xlabel('iteration times')
plt.ylabel('rate')
plt.show()
#python 一个折线图绘制多个曲线
matplotlib画图的更多相关文章
- python matplotlib画图产生的Type 3 fonts字体没有嵌入问题
ScholarOne's 对python matplotlib画图产生的Type 3 fonts字体不兼容,更改措施: 在程序中添加如下语句 import matplotlib matplotlib. ...
- 使用python中的matplotlib 画图,show后关闭窗口,继续运行命令
使用python中的matplotlib 画图,show后关闭窗口,继续运行命令 在用python中的matplotlib 画图时,show()函数总是要放在最后,且它阻止命令继续往下运行,直到1.0 ...
- matplotlib 画图
matplotlib 画图 1. 画曲线图 Tompson = np.array([0, 0, 0, 0, 0.011, 0.051, 0.15, 0.251, 0.35, 0.44, 0 ...
- python3 使用matplotlib画图出现中文乱码的情况
python3使用matplotlib画图,因python3默认使用中unicode编码,所以在写代码时不再需要写 plt.xlabel(u’人数’),而是直接写plt.xlabel(‘人数’). 注 ...
- matplotlib画图实例:pyplot、pylab模块及作图參数
http://blog.csdn.net/pipisorry/article/details/40005163 Matplotlib.pyplot画图实例 {使用pyplot模块} matplotli ...
- python使用matplotlib画图
python使用matplotlib画图 matplotlib库是python最著名的画图库.它提供了一整套和matlab类似的命令API.十分适合交互式地进行制图. 先介绍了怎样使用matplotl ...
- matplotlib画图报错This figure includes Axes that are not compatible with tight_layout, so results might be incorrect.
之前用以下代码将实验结果用matplotlib show出来 plt.plot(np.arange(len(aver_reward_list)), aver_reward_list) plt.ylab ...
- matplotlib画图出现乱码情况
python3使用matplotlib画图,因python3默认使用中unicode编码,所以在写代码时不再需要写 plt.xlabel(u’人数’),而是直接写plt.xlabel(‘人数’). 注 ...
- python使用matplotlib画图,jieba分词、词云、selenuium、图片、音频、视频、文字识别、人脸识别
一.使用matplotlib画图 关注公众号"轻松学编程"了解更多. 使用matplotlib画柱形图 import matplotlib from matplotlib impo ...
随机推荐
- BAPC2017
Benelux Algorithm Programming Contest 2017 参考资料: https://blog.csdn.net/sizaif/article/details/798586 ...
- POJ1742Coins(多重背包)
Coins Time Limit: 3000MS Memory Limit: 30000K Total Submissions: 32309 Accepted: 10986 Descripti ...
- Hadoop生态圈-Zookeeper的工作原理分析
Hadoop生态圈-Zookeeper的工作原理分析 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 无论是是Kafka集群,还是producer和consumer都依赖于Zoo ...
- unity2D动画和图片切割
视频地址: http://www.tudou.com/listplay/siFwDsllSEM.html 恩,我得到了素材,是这样的 这是一整张的图片,png格式的.很明显,这是类似于一个帧动画之 ...
- 查看windows下指定的端口是否开放
有时候会出现ip ping的通 但是就是连接不上的情况.这时候我们需要检测一下这个端口是否被开放 netstat -ano -p tcp | find >nul && ec ...
- Neural Networks and Deep Learning(week3)Planar data classification with one hidden layer(基于单隐藏层神经网络的平面数据分类)
Planar data classification with one hidden layer 你会学习到如何: 用单隐层实现一个二分类神经网络 使用一个非线性激励函数,如 tanh 计算交叉熵的损 ...
- Hibernate or 的用法
转自baidu estrictions.or(Restrictions.like(),Restrictions.or(Restrictions.like,........))里面的or可以无限加的.还 ...
- java 调用windows的COM组件举例(使用JACOB)
java 调用windows的COM组件举例(使用JACOB) (转自这里) 最近公司需要做一个效果,开发一个程序能在程序运行时打开microsoft office的相关软件,实时写入,然后能关闭,你 ...
- Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV
今天在使用JSP,引入<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> ...
- MySQL备份可能遇到的坑
MySQL备份工具,支持各种参数选项,使用不同的选项极有可能影响备份处理过程.本文使用我们常规认为合理的备份参数,测试/验证是否存在容易忽视的坑 # 常规备份参数 # mysqldump shell& ...