Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
40 views
in Technique[技术] by (71.8m points)

python - How do I find the area in a valley inside my plot?

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)

enter image description here

question from:https://stackoverflow.com/questions/65893074/how-do-i-find-the-area-in-a-valley-inside-my-plot

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...