I know the function fill_between
from matplotlib allows to color space between curves. Now, I would like to know if I can retrieve this information, ie get the coordinates of the pixels that are now colored on my plotting window.
Here is a working example:
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0,10,100)
y = np.linspace(0,20,100)
plt.plot(x,y)
im = plt.fill_between(x,y)
Here I see a blue triangle, how can I get the coordinates of the points within this triangle? I have been searching through the PolyCollection
options, but nothing seems to fit what I want.
Here is an example of what fill_between
looks like:
Thanks for your help!