Title: fill_between, step='post' and NaN · Issue #19444 · matplotlib/matplotlib · GitHub
Open Graph Title: fill_between, step='post' and NaN · Issue #19444 · matplotlib/matplotlib
X Title: fill_between, step='post' and NaN · Issue #19444 · matplotlib/matplotlib
Description: Off-by-one error if using fill_between, step='post' import matplotlib.pyplot as plt import pandas as pd fig = plt.figure(1) ax = fig.add_subplot(111) df = pd.DataFrame(index=pd.date_range(start='2000-01-01', periods=10, freq='1D')) df['d...
Open Graph Description: Off-by-one error if using fill_between, step='post' import matplotlib.pyplot as plt import pandas as pd fig = plt.figure(1) ax = fig.add_subplot(111) df = pd.DataFrame(index=pd.date_range(start='20...
X Description: Off-by-one error if using fill_between, step='post' import matplotlib.pyplot as plt import pandas as pd fig = plt.figure(1) ax = fig.add_subplot(111) df = pd.DataFrame(index=pd.date_range(s...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/19444
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"fill_between, step='post' and NaN","articleBody":"Off-by-one error if using `fill_between`, `step='post'`\r\n\r\n\u003c!--A minimum code snippet required to reproduce the bug.\r\nPlease make sure to minimize the number of dependencies required, and provide\r\nany necessary plotted data.\r\nAvoid using threads, as Matplotlib is (explicitly) not thread-safe.--\u003e\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\nimport pandas as pd\r\n\r\nfig = plt.figure(1)\r\nax = fig.add_subplot(111)\r\n\r\ndf = pd.DataFrame(index=pd.date_range(start='2000-01-01', periods=10, freq='1D'))\r\ndf['data'] = [1,2,3,-4,-5,-6,7,8,9,-10]\r\n\r\ndf.plot(ax=ax, drawstyle='steps-post')\r\nax.fill_between(df[df \u003e 0].index, df[df \u003e 0].values.flatten(), step='post')\r\n```\r\n\r\n**Actual outcome**\r\n\r\n\r\n\r\n\r\n**Expected outcome**\r\n\r\nSome of the `df[df \u003e 0]` columns are not filled.\r\n\r\n**Matplotlib version**\r\n\u003c!--Please specify your platform and versions of the relevant libraries you are using:--\u003e\r\n * Operating system: Linux Kubuntu 20.04\r\n * Matplotlib version (`import matplotlib; print(matplotlib.__version__)`): 3.3.1\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): Qt5Agg\r\n * Python version: 3.8.5\r\n * Jupyter version (if applicable): IPython 7.17.0\r\n","author":{"url":"https://github.com/mankoff","@type":"Person","name":"mankoff"},"datePublished":"2021-02-03T12:45:13.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/19444/matplotlib/issues/19444"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:402d365c-0ed8-e77b-0df4-59eeef9a45c5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BB1E:F01E1:22B2C1C:2EAB177:6A546900 |
| html-safe-nonce | 75d9de485a176121f6e4a9d22659673779aa1775dec9fad48f226a01f60ddbeb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjFFOkYwMUUxOjIyQjJDMUM6MkVBQjE3Nzo2QTU0NjkwMCIsInZpc2l0b3JfaWQiOiI0MTk3NDg5NDYzMDYzMjQzMDA4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 05bf7fa02519dcbb224a3ffcf64e0590fc9263d82d76d89eb387371067e94f0b |
| hovercard-subject-tag | issue:800295412 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/19444/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a0692885adf668b883aa3054bb114992ae75d3148cd2177de8186a283c25a0dd/matplotlib/matplotlib/issues/19444 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a0692885adf668b883aa3054bb114992ae75d3148cd2177de8186a283c25a0dd/matplotlib/matplotlib/issues/19444 |
| og:image:alt | Off-by-one error if using fill_between, step='post' import matplotlib.pyplot as plt import pandas as pd fig = plt.figure(1) ax = fig.add_subplot(111) df = pd.DataFrame(index=pd.date_range(start='20... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mankoff |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6d28624802c2f7d9500239dd6870ed7031b7353b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width