Title: [ENH]: contour at discontinuities: add max_jump parameter · Issue #21348 · matplotlib/matplotlib · GitHub
Open Graph Title: [ENH]: contour at discontinuities: add max_jump parameter · Issue #21348 · matplotlib/matplotlib
X Title: [ENH]: contour at discontinuities: add max_jump parameter · Issue #21348 · matplotlib/matplotlib
Description: Problem Follow up on #21309. The problem is contour on discontinuous functions. Mpl makes the (sane) assumption that, if a quad's corners have the values 0.0 and 0.78, the level contour of 0.51 (for example) has to pass somewhere through...
Open Graph Description: Problem Follow up on #21309. The problem is contour on discontinuous functions. Mpl makes the (sane) assumption that, if a quad's corners have the values 0.0 and 0.78, the level contour of 0.51 (fo...
X Description: Problem Follow up on #21309. The problem is contour on discontinuous functions. Mpl makes the (sane) assumption that, if a quad's corners have the values 0.0 and 0.78, the level contour of 0.51...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/21348
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[ENH]: contour at discontinuities: add max_jump parameter","articleBody":"### Problem\r\n\r\nFollow up on #21309.\r\n\r\nThe problem is `contour` on discontinuous functions. Mpl makes the (sane) assumption that, if a quad's corners have the values 0.0 and 0.78, the level contour of 0.51 (for example) has to pass somewhere through the quad, and draws it. This is incorrect where the function is _actually_ discontinuous, but of course mpl has no way of knowing that.\r\n\r\nSee [this stackoverflow post](https://stackoverflow.com/questions/28884344/handling-cyclic-data-with-matplotlib-contour-contourf) or [here](https://github.com/nschloe/cplot/issues/31).\r\n\r\n### Proposed solution\r\n\r\nA simple solution for this would be to allow for a user-supplied float parameter, `max_jump` or `discontinuity_threshold` or something like that, defaulting to `np.inf`. If within a quad the function values differ by _more_ than this threshold, a discontinuity is assumed and the level contour is assumed _not_ to pass through the quad.\r\n\r\n### Additional context and prior art\r\n\r\n_No response_","author":{"url":"https://github.com/nschloe","@type":"Person","name":"nschloe"},"datePublished":"2021-10-13T12:15:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/21348/matplotlib/issues/21348"}
| 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:0a1b825b-79de-607c-b7b4-105ffded14d6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B896:116E4B:4607914:5B8C30C:6A5D4A82 |
| html-safe-nonce | 2565aadc786017cc5fdd244341d1493b8124e997f11610bf21d0cd88ac9a2180 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCODk2OjExNkU0Qjo0NjA3OTE0OjVCOEMzMEM6NkE1RDRBODIiLCJ2aXNpdG9yX2lkIjoiNzQ5MDczNzkzNzQzNTE1MDk3OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7686b189c85186701fea87ff96e031bd8d54965aebf51d7d44d20d0bf73eb7dd |
| hovercard-subject-tag | issue:1025174131 |
| 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/21348/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b1b99698ca34fb9462f3aae2dff439de1179e271592992793e542e9f62d095dd/matplotlib/matplotlib/issues/21348 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b1b99698ca34fb9462f3aae2dff439de1179e271592992793e542e9f62d095dd/matplotlib/matplotlib/issues/21348 |
| og:image:alt | Problem Follow up on #21309. The problem is contour on discontinuous functions. Mpl makes the (sane) assumption that, if a quad's corners have the values 0.0 and 0.78, the level contour of 0.51 (fo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nschloe |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| 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 | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width