pyplot: import matplotlib.pyplot as plt | plt.figure(figsize=(8, 3)) #设置图像大小 |
plt.plot(x, y, 'b--', label='$\sinx + 1$', color='red', linewidth=2) #作图,设置线条颜色与格式、标签注释、线条颜色、线条大小 | |
plt.xlabel('Time(s)') #设置x轴名称 | |
plt.ylabel('Volt') #设置y轴名称 | |
plt.title('A Simple Example') #设置标题 | |
plt.ylim(0, 2.3) #设置y轴显示的范围 | |
plt.legend() #显示图例 | |
plt.show() #显示作图结果 |
matplotlib常用函数(更新中)
最新推荐文章于 2023-03-23 13:38:36 发布