Python plot,Matplot plot

import matplotlib.pyplot as plt
#这里应该把trace plot 出来,同时,还应该把峰值给plot出来;
plt.figure()
plt.plot(sigAv, color='red', label='dis')
plt.plot(peaks, sigAv[peaks], "x")
plt.savefig(output)
plt.show()

plt.figure()
ax = bodyPart1['dis'].plot.line(color='blue', label='hand')
ax.set_xlabel('Frame')
ax.set_ylabel('Distance(pixel)')
plt.title('Distance from body part to nose(x:{},y:{})'.format(noseX, noseY))
plt.legend(loc='best')
plt.savefig(FigHandDistancePath)#保存图片
plt.legend(loc = "best")
plt.show()

散点图的设置:s=3代表大小等于3

fig,ax = plt.subplots()
ax.plot(time, ct, color = 'b', label = 'true')
ax.scatter(time, ctn, color = 'r',s=3, label = 'add noise')

ax.set_xlabel('Frame')
ax.set_ylabel('Calcium Transient')
plt.title('Gamma is {}'.format(gamma))
plt.legend(loc = "best")
fig.show()

posted @ 2021-06-16 18:27  bH1pJ  阅读(18)  评论(0编辑  收藏  举报