I have a plot of Heat flow vs Temperature. I am pretty new so I may be missing something obvious, but I wanted to find the area of a valley in my plot. I plotted my values given by DSC, and the lines are the area I wanted to find. I have been trying to take an integral of this range but no sucess.
plt.figure()
plt.plot(Ts, abs(HF),'k')
plt.plot([650,765],[153,153], 'r')
plt.plot([665,725],[145,145])
plt.grid(color='k', linestyle='-', linewidth=0.5)
plt.title('Heat Flow vs Temperature')
plt.xlabel('Temperature (C)')
plt.ylabel('Heat Flow (mW)')
plt.show()
fx=[Ts, abs(HF)]
integral = np.trapz(abs(HF)[650:765])
print(integral)
question from:
https://stackoverflow.com/questions/65893074/how-do-i-find-the-area-in-a-valley-inside-my-plot 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…