How to calculate the area under the curve with Plotly


Is it possible to calculate this area?

Hi,

I guess you are creating this are with the buitlin function, right?

I could not find anything builtin, but I would google for โ€œcalculate area under curve discrete pointsโ€. This looks like a good starting point. Iโ€™d try with a simple curve first.

1 Like

My main problem is that I have to calculate it for each measurement in this graph. I donโ€™t have any idea on how to start solving it. Like how would I seperate each measurement? And is that even necessary?

Hi @joziask, thatโ€™s actually not related to plotly/Dash and you might be better off, asking on stackoverflow :upside_down_face:

Anyways, I would try something like this:

  • find peaks
  • define a relevant time range for each peak (maybe a constant value like [peak-t, peak+t] but it depends on your needs)
  • calculate the area for each peak