FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fill_demo and fill_between_demo are slightly misleading · Issue #5827 · matplotlib/matplotlib · GitHub

Repository navigation

fill_demo and fill_between_demo are slightly misleading #5827

Closed

Description

http://matplotlib.org/examples/lines_bars_and_markers/fill_demo.html
http://matplotlib.org/examples/lines_bars_and_markers/fill_demo_features.html

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?

Activity

  1. mdboom commented on Jan 11, 2016

    Member

    I agree that would improve things.

  2. jenshnielsen commented on Jan 11, 2016

    Member

    Tagged with MEP12 since this relates to the more general example improvement effort defined in MEP12

  3. anntzer commented on Jan 11, 2016

    ContributorAuthor

    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.

  4. 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?

  5. phobson commented on Apr 28, 2017

    Member

    @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

  6. 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 ?

  7. 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.

  8. QuLogic commented on Jul 21, 2020

    Member

    Seems like these examples are merged and the misleading parts are fixed by #11009.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    MEP: MEP12gallery and examples improvements

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL