Python:使用matplotlib画三角曲线图
2017-08-14 22:14
393 查看
import numpy as np import matplotlib.pyplot as plt x=np.linspace(-10,10,1000) a=np.sin(x) b=np.cos(x) c=np.tan(x) d=np.log(x) plt.figure(figsize=(8,4)) plt.plot(x,a,label='$sin(x)$',color='green',linewidth=0.5) plt.plot(x,b,label='$cos(x)$',color='red',linewidth=0.5) plt.plot(x,c,label='$tan(x)$',color='blue',linewidth=0.5) plt.plot(x,d,label='$log(x)$',color='grey',linewidth=0.5) plt.xlabel('Time(s)') plt.ylabel('Volt') plt.title('PyPlot') plt.xlim(-10,10) plt.ylim(-5,5) plt.legend() plt.show()
相关文章推荐
- python中matplotlib使用双y轴的时候,只能显示第二个曲线标志怎么办?
- Python使用matplotlib绘制三维曲线
- Python中使用matPlotlib绘图-曲线图、柱状图、散列点
- pyqt中使用matplotlib绘制动态曲线 – pythonic
- Python使用matplotlib绘制正弦和余弦曲线的方法示例
- Python--绘图工具matplotlib的使用
- python使用matplotlib绘图 -- barChart
- 转:使用 python Matplotlib 库 绘图 及 相关问题
- 使用 python Matplotlib 库绘图
- 使用 python Matplotlib 库绘图
- 广义mandelbrot集,使用python的matplotlib绘制,支持放大缩小
- 使用 python Matplotlib 库绘图
- python使用matplotlib绘图 -- barChart
- 使用 python Matplotlib 库绘图
- Python绘图和数值工具:matplotlib 和 numpy下载与使用
- python 使用numpy matplotlib绘制图表
- 使用 python Matplotlib 库绘图
- 使用 python Matplotlib 库绘图
- 使用Matplotlib与Python
- Python绘图和数值工具:matplotlib 和 numpy下载与使用