Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Labels
Milestone
Description
fill_between doesn't give the result I expect if using a log y-axis and having a value of 0 in the y1 array.
Example:
%matplotlibinlineimportnumpyasnpimportmatplotlib.pyplotaspltx=np.array([1,2,3,4,5])y1=np.array([9,2,8,3,0])y2=np.array([10,10,10,10,10])plt.plot(x,y1,lw=3,color='green')plt.plot(x,y2,lw=3,color='red')plt.fill_between(x,y1,y2)plt.loglog()
Actual outcome:
The polygon created by fill_between somehow connects the last and first point, resulting in a completely incorrect patch:
Expected outcome
I was expecting / hoping that the band would be filled correctly and simply clipped (i.e. the result I get when changing the last y1 value from 0 to e.g. 1e-10). In the plot, the blue fill should be between the red and green line.
Matplotlib version
This is with Matplotlib 2.0.0.
(on Macports, but I don't think that matters)