How can I extract the x/y data from the resulting PolyCollection from a fill_between
plot?
polyCollection = ax.fill_between(x,ylo,yhi)
Now how do I get the data back from polyCollection
?
For other Collection
objects, I use x, y = artist.get_offsets().T
, but here that returns just zeros for some reason.
For "Line" type objects, I use x, y = artist.get_xdata(), artist.get_ydata()
.
(I use this information in a callback to locally auto-zoom the y-axis to fit the data within a certain x-range.)