matplotlib.pyplot
来源:互联网 发布:盛世汉桥 知乎 编辑:程序博客网 时间:2024/05/22 11:39
import numpy as npimport matplotlib.pyplot as pltx,y=[],[]for sample in open("prices.txt","r"): _x,_y=sample.split(",") x.append(float(_x)) y.append(float(_y))x,y=np.array(x),np.array(y)x=(x-x.mean())/x.std()fig1=plt.figure()#定义画布 在定义另一个画布之前都在这个画布上操作ax1 = fig1.add_subplot(211)#在fig1画布里画出第一个行子图ax1.plot(x, x ** 3)ax2 = fig1.add_subplot(212)#在fig1画布里画出第二个行子图ax2.plot(x, np.log(x))# plt.scatter(x,y,c="red",s=60)fig2 = plt.figure()#定义另一个画布ax2 = fig2.add_subplot(121)#在fig2画布里画出第一个列子图ax2.plot(x, np.sqrt(x))ax4 = fig2.add_subplot(122)#在fig2画布里画出第二个列子图ax4.plot(x, x ** 2)# plt.scatter(x,y,c="green",s=60)#c代表颜色,s代表点的大小plt.show()
阅读全文
0 0
- matplotlib.pyplot
- matplotlib.pyplot
- python matplotlib.pyplot importerror
- 【python】matplotlib.pyplot介绍
- matplotlib.pyplot.imshow
- matplotlib.pyplot介绍
- matplotlib.pyplot画图
- matplotlib.pyplot入门
- Python---matplotlib.pyplot
- matplotlib.pyplot.py
- matplotlib.pyplot介绍
- 学习matplotlib--pyplot教程
- 【python】matplotlib.pyplot入门
- import matplotlib.pyplot 错误
- matplotlib.pyplot.figure
- matplotlib.pyplot.subplot
- matplotlib入门之Pyplot
- matplotlib.pyplot.hist(柱状图)
- c_str使用规范
- 欢迎使用CSDN-markdown编辑器
- 算式类型字符串表达式读取并计算出结果(简单四则运算)--后缀表达式计算
- 在类中调用opencv的setMouseCallback
- fabricjs clipTo
- matplotlib.pyplot
- 表格游戏!
- Java题目Matrix_Add
- 揭秘Angular 2-基本类型
- 英语札记 4
- 更改CI框架默认访问路径及去掉index.php
- C++primer 第五版课后习题 第六章(2)21-38
- PAT乙级1030 完美数列
- 每颗电池都可追溯 沃特玛大数据监控平台保障运行安全