Title: Inconsistent Corner Masking w/ plot_surface · Issue #16470 · matplotlib/matplotlib · GitHub
Open Graph Title: Inconsistent Corner Masking w/ plot_surface · Issue #16470 · matplotlib/matplotlib
X Title: Inconsistent Corner Masking w/ plot_surface · Issue #16470 · matplotlib/matplotlib
Description: Inconsistent Corner Masking w/ plot_surface plot_surface inconsistently corner masks and even may not plot certain values when given a non-rectangular array. import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl fro...
Open Graph Description: Inconsistent Corner Masking w/ plot_surface plot_surface inconsistently corner masks and even may not plot certain values when given a non-rectangular array. import numpy as np import matplotlib.py...
X Description: Inconsistent Corner Masking w/ plot_surface plot_surface inconsistently corner masks and even may not plot certain values when given a non-rectangular array. import numpy as np import matplotlib.py...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/16470
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inconsistent Corner Masking w/ plot_surface","articleBody":"### Inconsistent Corner Masking w/ plot_surface\r\n\r\nplot_surface inconsistently corner masks and even may not plot certain values when given a non-rectangular array.\r\n\r\n\r\n```python\r\n\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib as mpl\r\nfrom mpl_toolkits.mplot3d import axes3d\r\n\r\nx = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]\r\ny = [1, 2, 3, 4, 5, 6, 7, 8]\r\n\r\nX, Y = np.meshgrid(x, y)\r\n\r\nmatrix = np.array([[np.nan, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],\r\n [np.nan, 1.0, 2.0, 3.0, 4.0, 4.0, 4.0, 3.0, 2.0, 1.0, 1.0],\r\n [np.nan, np.nan, 4.0, 5.0, 6.0, 8.0, 6.0, 5.0, 4.0, 3.0, np.nan],\r\n [np.nan, np.nan, 7.0, 8.0, 11.0, 12.0, 11.0, 8.0, 7.0, np.nan, np.nan],\r\n [np.nan, np.nan, 8.0, 9.0, 10.0, 16.0, 10.0, 9.0, 10.0, 7.0, np.nan],\r\n [np.nan, np.nan, np.nan, 12.0, 16.0, 20.0, 16.0, 12.0, 11.0, np.nan, np.nan],\r\n [np.nan, np.nan, np.nan, np.nan, 22.0, 24.0, 22.0, 20.0, 18.0, np.nan, np.nan],\r\n [np.nan, np.nan, np.nan, np.nan, np.nan, 28.0, 26.0, 25.0, np.nan, np.nan, np.nan]])\r\nmaskMat = np.ma.masked_invalid(matrix)\r\nprint(maskMat)\r\n\r\nfig = plt.figure()\r\nax = fig.gca(projection = '3d')\r\nnormC = mpl.colors.Normalize(vmax = maskMat.max(), vmin = maskMat.min())\r\ncolors = mpl.cm.plasma(normC(maskMat))\r\nsurf = ax.plot_surface(X, Y, maskMat, norm = normC)\r\nplt.show()\r\n```\r\n\r\n**Actual outcome**\r\nCorner masking only happens on the left and not on the right:\r\n\r\n\r\nA case where a point is dropped:\r\n\r\n\r\n\r\n\u003c!--The output produced by the above code, which may be a screenshot, console output, etc.--\u003e\r\n\r\n\r\n**Expected outcome**\r\nCorner masking consistently, and/or a way to control it like in contourf\r\n\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: Windows 10\r\n * Matplotlib version: 3.1.3\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): TkAgg\r\n * Python version: 3.7.3\r\n * Other libraries: Numpy 1.18.1\r\n\r\nMatplotlib was installed via PyCharm Community edition\r\n\r\n","author":{"url":"https://github.com/b0ndman","@type":"Person","name":"b0ndman"},"datePublished":"2020-02-11T00:36:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/16470/matplotlib/issues/16470"}
| 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:7e55645a-fb93-c3eb-2a96-3de2aba0cc59 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8ED0:1D73CC:7D6980:A8CF3E:6A569DC5 |
| html-safe-nonce | 37352f0fb270a2065812ff0c5acf3a0347b5d08f623c61634feb25749dd879c5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RUQwOjFENzNDQzo3RDY5ODA6QThDRjNFOjZBNTY5REM1IiwidmlzaXRvcl9pZCI6IjU5MTIyNjQxMTk1ODgxMzQzNDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0387c78d9f43105ae2407f8518547d5d7a2239c0ed47d63a358ccbd15c62c75d |
| hovercard-subject-tag | issue:562912269 |
| 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/16470/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a886fbe7590ecf70c97a2c8ed6b906aa67227f0e7b20359eba2e67db0fee5e5e/matplotlib/matplotlib/issues/16470 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a886fbe7590ecf70c97a2c8ed6b906aa67227f0e7b20359eba2e67db0fee5e5e/matplotlib/matplotlib/issues/16470 |
| og:image:alt | Inconsistent Corner Masking w/ plot_surface plot_surface inconsistently corner masks and even may not plot certain values when given a non-rectangular array. import numpy as np import matplotlib.py... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | b0ndman |
| hostname | github.com |
| expected-hostname | github.com |
| None | 647a25f437e2f54eccdd162bd007c8ae70f4235c4125dba0f4518747cc8b9615 |
| 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 | 05adb86a60ce3d701e556eded3ab26300ec6bcc4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width