Title: Missing filled contours when using contourf · Issue #11587 · matplotlib/matplotlib · GitHub
Open Graph Title: Missing filled contours when using contourf · Issue #11587 · matplotlib/matplotlib
X Title: Missing filled contours when using contourf · Issue #11587 · matplotlib/matplotlib
Description: I am trying to plot plot a function over a 2D domain using contourf. Unfortunately, my first attempt did not work out very well. There was a region in the plot that was unexpectedly not covered by any contours. For debugging purposes, I ...
Open Graph Description: I am trying to plot plot a function over a 2D domain using contourf. Unfortunately, my first attempt did not work out very well. There was a region in the plot that was unexpectedly not covered by ...
X Description: I am trying to plot plot a function over a 2D domain using contourf. Unfortunately, my first attempt did not work out very well. There was a region in the plot that was unexpectedly not covered by ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/11587
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Missing filled contours when using contourf","articleBody":"I am trying to plot plot a function over a 2D domain using `contourf`. Unfortunately, my first attempt did not work out very well. There was a region in the plot that was unexpectedly not covered by any contours. For debugging purposes, I have reduced the problem to the smallest dataset that I could find that also reveals the issue with missing filled contours:\r\n\r\n```\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\nv = np.array([0, 1, 2, 3])\r\nx, y = np.meshgrid(v, v)\r\n\r\nz = np.array([[5.5e-14, 5.5e-14, 5.5e-14, 5.5e-14],\r\n [2e-13, 2e-13, 2e-13, 2e-13],\r\n [2.2e-13, 2.2e-13, 2.2e-13, 2.2e-13],\r\n [0, 0,0, 0]])\r\nfig, ax = plt.subplots()\r\ncntr = ax.contourf(x, y, z)\r\nfig.colorbar(cntr, ax=ax)\r\nplt.show()\r\n```\r\n\r\n\r\nas you can see there are missing contours from `y = 1.5` to approximately `y = 2.0`.\r\n\r\nAnother strange thing I observed: If I normalize the `z` matrix by multiplying by e.g. `1e14` before plotting it works fine.\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: Ubuntu 18.04\r\n * Matplotlib version: 2.2.2 (Installed with `pip`)\r\n * Matplotlib backend: TkAgg\r\n * Python version: 3.6.1\r\n\r\nNote: This question was first asked on stackoverflow.com: [Missing filled contours when using contourf](https://stackoverflow.com/q/51210497/2173773)\r\n\r\n","author":{"url":"https://github.com/hakonhagland","@type":"Person","name":"hakonhagland"},"datePublished":"2018-07-06T12:58:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/11587/matplotlib/issues/11587"}
| 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:6a8723f8-214d-41fa-17ef-7c98dacfc299 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A68E:2ACA74:2FB58BD:44AE9BE:6A5674BE |
| html-safe-nonce | 5fcea203dcaca13fb853b7c8a0f7d6a0cd1f4954476fb5e76e0332080563d0bd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjhFOjJBQ0E3NDoyRkI1OEJEOjQ0QUU5QkU6NkE1Njc0QkUiLCJ2aXNpdG9yX2lkIjoiODkyODQ5MTg2MzQwNjk2NTk1MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c199646069b788ff755fbd31fd6f56a12b9f7431da72e697357f985e7aa99c1f |
| hovercard-subject-tag | issue:338929782 |
| 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/11587/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b8609c21d17382993c19a9ca248da72e6d7b1d2d974bcacbee741818ad01edc6/matplotlib/matplotlib/issues/11587 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b8609c21d17382993c19a9ca248da72e6d7b1d2d974bcacbee741818ad01edc6/matplotlib/matplotlib/issues/11587 |
| og:image:alt | I am trying to plot plot a function over a 2D domain using contourf. Unfortunately, my first attempt did not work out very well. There was a region in the plot that was unexpectedly not covered by ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hakonhagland |
| hostname | github.com |
| expected-hostname | github.com |
| None | 19b5ee9431dcfce15ab4b001d626e4e3a6ba1acb7be814813a52bbebd9a86ef5 |
| 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 | afc01ffdb045f4ff81c6122091366ade7b6166b7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width