Both examples show fill behaving more or less as fill_between would, and it took me a while to realize that this is because the first and last points plotted both have y=0 and thus the line closing the polygon is at y=0. Perhaps a different example would be clearer?
Newbie here. I pulled the repo. But it contains fill.py, which does both the plots for fill_demo.html and fill_demo_features.html. How can I resolve the issue? Should I change as suggested by @anntzer in fill.py?
@pssk1988 this issue is a little stale. The two examples have been merged into the fill.py file that you see. Modifying those examples should suffice to address this issue.
@phobson : Then shall we leave the second plot (demo_features) with sinusoidal curves as it is? Or should I change it to overlapping polygons as suggested by @anntzer ?
I made some simple changes to fill.py in pull request #11009. I changed the first example to be a polygon (as suggested here) and the second to ensure that the polygon didn't finish at y=0 anymore.
Activity
mdboom commented on Jan 11, 2016
I agree that would improve things.
jenshnielsen commented on Jan 11, 2016
Tagged with MEP12 since this relates to the more general example improvement effort defined in MEP12
anntzer commented on Jan 11, 2016
Suggestion:
use plt.fill([0, 0, 1, 2, 2], [0, 1, 2, 1, 0])
for fill_demo
and plt.fill([0, 0, 1, 2, 2], [0, 1, 2, 1, 0], "b", [1, 1, 2, 3, 3], [1, 2, 3, 2, 1], "r", alpha=.3)
for fill_demo_features.
I'll make a PR if this sounds good.
SKPsanjeevi commented on Apr 28, 2017
Newbie here. I pulled the repo. But it contains fill.py, which does both the plots for fill_demo.html and fill_demo_features.html. How can I resolve the issue? Should I change as suggested by @anntzer in fill.py?
phobson commented on Apr 28, 2017
@pssk1988 this issue is a little stale. The two examples have been merged into the fill.py file that you see. Modifying those examples should suffice to address this issue.
http://matplotlib.org/devdocs/gallery/lines_bars_and_markers/fill.html#sphx-glr-gallery-lines-bars-and-markers-fill-py
SKPsanjeevi commented on Apr 28, 2017
@phobson : Then shall we leave the second plot (demo_features) with sinusoidal curves as it is? Or should I change it to overlapping polygons as suggested by @anntzer ?
Changed fill.py example to be less misleading, after issue matplotlib…
samvaughan commented on Apr 9, 2018
I made some simple changes to fill.py in pull request #11009. I changed the first example to be a polygon (as suggested here) and the second to ensure that the polygon didn't finish at y=0 anymore.
QuLogic commented on Jul 21, 2020
Seems like these examples are merged and the misleading parts are fixed by #11009.