Does anyone know if it is possible to calculate the overlapping area of two ellipses using matplotlib.patches.Ellipse
.
I have to ellipses like this:
And i would like to calculate the ratio between the overlap area and the are of the individual ellipses.
Is this possible using only the Ellipse
from matplotlib.patches
You cannot compute the area of the intersect with
matplotlib
(at least not to my knowledge), but you can useshapely
to do so and then usematplotlib
to visualise the result. Here a quick demo:The resulting plot looks like this:
And the computed areas (printed out to the terminal) are:
Note that I adapted the code to generate the ellipse-shaped polygon from this post. Hope this helps.