python简单的绘制折现图
来源:互联网 发布:任子行网络评价 编辑:程序博客网 时间:2024/06/06 07:33
在做一些数据统计时,折现图能够看出变化的趋势,最近查内存泄漏,跑了一个晚上的数据,想查查,那么折现图能够给一个很直观的结果。
我们使用pylab包来绘制图形。
我使用pip来管理python包
sudo pip install pylab
时间比较长,其会下载一些依赖的包。
#!/usr/bin/pythonimport osimport matplotlib.pyplot as pltallFile = []r = open('result', 'w')heap = [] for filename in sorted(os.listdir(os.path.dirname('./'))): if filename.endswith('.txt'): allFile.append(filename)for afile in allFile: f = open(afile); data = f.readlines(); t = data[1699].split(':')[1].strip() heap.append(int(t)) r.write(t + '\n')r.close();dataLen = len(heap)plt.plot(range(1, dataLen + 1), heap)plt.show()
这是我写的简单的统计程序。
plt.plot()
接受两个参数,分别是x,y轴的数据。
结果如图:
2 0
- python简单的绘制折现图
- python简单的绘制折现图
- python绘制简单的热图
- python opencv 绘制简单图形
- Python-Matplotlib绘制简单图像
- Python绘制PDF文件~超简单的小程序
- 使用python绘制一个简单的三维图
- 简单的直方图绘制
- 绘制简单的矩形
- 使用python matplotlib绘制简单图形
- Win8简单几何图形的绘制
- android 分布图的简单绘制
- cocos2d-x简单的绘制
- GDI绘制简单的图形
- Paint绘制简单的进度条
- Unity Inspector的简单绘制
- python matplotlib 方程的绘制
- python matplotlib图像的绘制
- [Leetcode] 212. Word Search @python
- 《leetCode》:Construct Binary Tree from Inorder and Postorder Traversal
- UVa 11400 Lighting System Design dp : 线性结构上dp LIS
- 访问单个节点的删除
- CodeForces 618 A. Slime Combining(水~)
- python简单的绘制折现图
- 1049. Counting Ones (30)
- ZOJ3537 解题报告及总结
- 数据挖掘笔记:Review_2
- 理解泛函的概念和能量泛函的梯度下降流
- Python XML解析
- ANSI和unicode编码
- 01背包问题——饭卡
- LeetCode:Increasing Triplet Subsequence