Find the area between two curves plotted in matplotlib (fill_between area)

后端 未结 5 1247
生来不讨喜
生来不讨喜 2020-12-08 08:39

I have a list of x and y values for two curves, both having weird shapes, and I don\'t have a function for any of them. I need to do two things: (1) plot it and shade the ar

5条回答
  •  粉色の甜心
    2020-12-08 08:42

    The area_between_two_curves function in pypi library similaritymeasures (released in 2018) might give you what you need. I tried a trivial example on my side, comparing the area between a function and a constant value and got pretty close tie-back to Excel (within 2%). Not sure why it doesn't give me 100% tie-back, maybe I am doing something wrong. Worth considering though.

提交回复
热议问题