Title: Better error message in scatter plot when len(x) != len(c) · Issue #7314 · matplotlib/matplotlib · GitHub
Open Graph Title: Better error message in scatter plot when len(x) != len(c) · Issue #7314 · matplotlib/matplotlib
X Title: Better error message in scatter plot when len(x) != len(c) · Issue #7314 · matplotlib/matplotlib
Description: import numpy as np import matplotlib.pyplot as plt N = 500 x = np.random.rand(N) y = np.random.rand(N) colors = np.random.rand(N+1) fig, ax = plt.subplots() ax.scatter(x, y, c=colors) plt.show() raises the following error: ValueError: In...
Open Graph Description: import numpy as np import matplotlib.pyplot as plt N = 500 x = np.random.rand(N) y = np.random.rand(N) colors = np.random.rand(N+1) fig, ax = plt.subplots() ax.scatter(x, y, c=colors) plt.show() ra...
X Description: import numpy as np import matplotlib.pyplot as plt N = 500 x = np.random.rand(N) y = np.random.rand(N) colors = np.random.rand(N+1) fig, ax = plt.subplots() ax.scatter(x, y, c=colors) plt.show() ra...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/7314
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Better error message in scatter plot when len(x) != len(c)","articleBody":"``` python\nimport numpy as np\nimport matplotlib.pyplot as plt\nN = 500\nx = np.random.rand(N)\ny = np.random.rand(N)\ncolors = np.random.rand(N+1)\n\nfig, ax = plt.subplots()\nax.scatter(x, y, c=colors)\nplt.show()\n```\n\nraises the following error:\n`ValueError: Invalid RGBA argument: 0.23991184171163127`\n\nwhich is _absolutely_ unrelated to the problem. We need a better error message when the color is not of the correct shape.\n","author":{"url":"https://github.com/NelleV","@type":"Person","name":"NelleV"},"datePublished":"2016-10-20T19:23:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/7314/matplotlib/issues/7314"}
| 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:ce7ca11f-2153-87b4-b0f5-183942145952 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 92CE:16C913:2050A14:2CE36C0:6A55F7EB |
| html-safe-nonce | eaad9ae00b4c6a969c0569e03dde34b4a8f4f01dcd1abf5dc93d7820d451808d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MkNFOjE2QzkxMzoyMDUwQTE0OjJDRTM2QzA6NkE1NUY3RUIiLCJ2aXNpdG9yX2lkIjoiMzUwOTA3MjQ1MTA5MDExODYzNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9f9fab09bc5b4f6dd8492dd3bb14a7f333352f98ffcc750750751f099b16a737 |
| hovercard-subject-tag | issue:184317895 |
| 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/7314/issue_layout |
| twitter:image | https://opengraph.githubassets.com/84ccfa35eeebe271c149f08d77795ec5fe015bed19a6283019ec8f02032ad663/matplotlib/matplotlib/issues/7314 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/84ccfa35eeebe271c149f08d77795ec5fe015bed19a6283019ec8f02032ad663/matplotlib/matplotlib/issues/7314 |
| og:image:alt | import numpy as np import matplotlib.pyplot as plt N = 500 x = np.random.rand(N) y = np.random.rand(N) colors = np.random.rand(N+1) fig, ax = plt.subplots() ax.scatter(x, y, c=colors) plt.show() ra... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | NelleV |
| hostname | github.com |
| expected-hostname | github.com |
| None | b5665c84831ed9ac4fb79519c16c9c5580ba8092fb8bb6e3e72972ec7197348e |
| 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 | 3725c7f9b2a6e3a27ef57c5aed13428c0f65e045 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width