Matplotlib--基本画图
2017-10-12 21:40
302 查看
显示图像及画线
import numpy as np
import matplotlib.pyplot as plt
#####################1
x = np.linspace(-5, 5, 30) # X axis data
y = np.sin(x) * x ** 2 + 1
plt.figure()
plt.plot(x, y)
plt.scatter(x, y, c='r')
plt.savefig('d:/f1.png')
plt.figure(2)
plt.bar(x,y, yerr=np.random.normal(0,3, y.shape),width=0.2)
plt.bar(x, y, bottom= y,yerr=np.random.normal(0,3, y.shape), color='y',width=0.2)
plt.savefig('d:/f2.png')
plt.show()
marker options:
import numpy as np
import matplotlib.pyplot as plt
#####################1
x = np.linspace(-5, 5, 30) # X axis data
y = np.sin(x) * x ** 2 + 1
plt.figure()
plt.plot(x, y)
plt.scatter(x, y, c='r')
plt.savefig('d:/f1.png')
plt.figure(2)
plt.bar(x,y, yerr=np.random.normal(0,3, y.shape),width=0.2)
plt.bar(x, y, bottom= y,yerr=np.random.normal(0,3, y.shape), color='y',width=0.2)
plt.savefig('d:/f2.png')
plt.show()
marker options:
相关文章推荐
- python中引用matplotlib画图的几个常用命令及基本步骤
- matplotlib基本画图示例
- matplotlib画图时的中文设置
- python matplotlib 画图
- python matplotlib画图
- matplotlib画图基础,华氏温度到摄氏温度的转换
- matplotlib的基本用法(十六)——创建动画
- 【转】matplotlib画图时的中文设置
- python matplotlib 画图保存图片简单例子
- Python:Matplotlib 画图
- matplotlib 画图
- 【Python】Matplotlib画图(九)——饼图
- matplotlib基本用法-【老鱼学matplotlib】
- python matplotlib 画图知识点列表
- Python matplotlib画图实例之绘制拥有彩条的图表
- 用matplotlib来画图-python学习笔记16
- matplotlib 画图 华氏度-摄氏度转化
- Matplotlib基本操作
- python Matplotlib画图之调整字体大小的示例
- Matplotlib常用画图代码2