Title: RGB not supported in pcolormesh · Issue #4277 · matplotlib/matplotlib · GitHub
Open Graph Title: RGB not supported in pcolormesh · Issue #4277 · matplotlib/matplotlib
X Title: RGB not supported in pcolormesh · Issue #4277 · matplotlib/matplotlib
Description: Hello, When using imshow, it's possible to pass either a 2D array (which is rendered as false color via a colormap) or a 3D array where the last dimension is 3 (or perhaps 4, I've not tested). In the latter case, the data is rendered ass...
Open Graph Description: Hello, When using imshow, it's possible to pass either a 2D array (which is rendered as false color via a colormap) or a 3D array where the last dimension is 3 (or perhaps 4, I've not tested). In t...
X Description: Hello, When using imshow, it's possible to pass either a 2D array (which is rendered as false color via a colormap) or a 3D array where the last dimension is 3 (or perhaps 4, I've not teste...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/4277
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"RGB not supported in pcolormesh","articleBody":"Hello,\n When using imshow, it's possible to pass either a 2D array (which is rendered as false color via a colormap) or a 3D array where the last dimension is 3 (or perhaps 4, I've not tested). In the latter case, the data is rendered assuming the last dimension means color, i.e. the data is in RGB format. When using pcolormesh, however, only the first behaviour works; passing RGB data simply results in an error:\n\n```\nTraceback (most recent call last):\n File \"C:\\Users\\Richard\\Desktop\\2015_02_10_CB7_Nap\\test_rgb_idealised.py\", line 19, in \u003cmodule\u003e\n m = plt.pcolormesh(x, y, rgb/255.0, linewidth=0)\n File \"C:\\Anaconda\\lib\\site-packages\\matplotlib\\pyplot.py\", line 2946, in pcolormesh\n ret = ax.pcolormesh(*args, **kwargs)\n File \"C:\\Anaconda\\lib\\site-packages\\matplotlib\\axes.py\", line 7736, in pcolormesh\n X, Y, C = self._pcolorargs('pcolormesh', *args, allmatch=allmatch)\n File \"C:\\Anaconda\\lib\\site-packages\\matplotlib\\axes.py\", line 7351, in _pcolorargs\n numRows, numCols = C.shape\nValueError: too many values to unpack\n```\n\nSo, my question is whether pcolormesh should only support false color data, or whether RGB support ought to be included. I found a work-around which I documented here:\nhttp://stackoverflow.com/questions/29232439/plotting-an-irregularly-spaced-rgb-image-in-python/29232668?noredirect=1#comment46710586_29232668\n\nFor reference, I'm running v1.3.1 of matplotlib, on Windows (64 bit) via Anaconda.\n\nThanks,\n\nRichard\n","author":{"url":"https://github.com/rwb27","@type":"Person","name":"rwb27"},"datePublished":"2015-03-25T16:24:46.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":14},"url":"https://github.com/4277/matplotlib/issues/4277"}
| 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:8c607b59-ef94-4c53-0d9f-29a8c680624b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E9E0:8E3D:E31149:12B128E:6A528FE8 |
| html-safe-nonce | 679a41ab6561445f162e0e3e2d5dbe39edc28f0d55b23ff566bfdc31c47b0d79 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOUUwOjhFM0Q6RTMxMTQ5OjEyQjEyOEU6NkE1MjhGRTgiLCJ2aXNpdG9yX2lkIjoiMTM5ODYyNjcxMTI2NDk4OTE2MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ede37063ddbc9c2f8377007fc98a89d4b1b39115456673a80b3e7eb718e06404 |
| hovercard-subject-tag | issue:64311851 |
| 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/4277/issue_layout |
| twitter:image | https://opengraph.githubassets.com/99e17ee166cdc613e61aeba76c7312d252593e7c822b9e4f734dd68ae33fd81c/matplotlib/matplotlib/issues/4277 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/99e17ee166cdc613e61aeba76c7312d252593e7c822b9e4f734dd68ae33fd81c/matplotlib/matplotlib/issues/4277 |
| og:image:alt | Hello, When using imshow, it's possible to pass either a 2D array (which is rendered as false color via a colormap) or a 3D array where the last dimension is 3 (or perhaps 4, I've not tested). In t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rwb27 |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width