How to calculate the area under the curve with Plotly

Is it possible to calculate this area?


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.

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