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()

浙公网安备 33010602011771号