Title: Change in handling of scatter c= argument with shape (1, 4) · Issue #17431 · matplotlib/matplotlib · GitHub
Open Graph Title: Change in handling of scatter c= argument with shape (1, 4) · Issue #17431 · matplotlib/matplotlib
X Title: Change in handling of scatter c= argument with shape (1, 4) · Issue #17431 · matplotlib/matplotlib
Description: Bug report Bug summary In 3.2, scatter is color-mapping 4 points when the c input is 2D with shape (1, 4). This is a change from 3.1. The docs for scatter say Note that c should not be a single numeric RGB or RGBA sequence because that i...
Open Graph Description: Bug report Bug summary In 3.2, scatter is color-mapping 4 points when the c input is 2D with shape (1, 4). This is a change from 3.1. The docs for scatter say Note that c should not be a single num...
X Description: Bug report Bug summary In 3.2, scatter is color-mapping 4 points when the c input is 2D with shape (1, 4). This is a change from 3.1. The docs for scatter say Note that c should not be a single num...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/17431
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Change in handling of scatter c= argument with shape (1, 4)","articleBody":"### Bug report\r\n\r\n**Bug summary**\r\n\r\nIn 3.2, `scatter` is color-mapping 4 points when the `c` input is 2D with shape (1, 4). This is a change from 3.1.\r\n\r\nThe docs for `scatter` say\r\n\r\n\u003e Note that *c* should not be a single numeric RGB or RGBA sequence\r\n because that is indistinguishable from an array of values to be\r\n colormapped. If you want to specify the same RGB or RGBA value for\r\n all points, use a 2-D array with a single row. Otherwise, value-\r\n matching will have precedence in case of a size matching with *x*\r\n and *y*.\r\n\r\nHowever, this is no longer true.\r\n\r\nI suspect https://github.com/matplotlib/matplotlib/pull/17245 may be related (only based on milestone and description, I haven't debugged the code).\r\n\r\n**Code for reproduction**\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\n\r\nx = y = 1, 2, 3, 4\r\nc = [(.2, .5, .8, 1)]\r\n\r\nf, ax = plt.subplots()\r\nax.scatter(x, y, c=c, s=100) # Increase s for visibility\r\n```\r\n\r\n**Actual outcome**\r\n\r\nOn 3.2.1\r\n\r\n\r\n\r\n\r\n**Expected outcome**\r\n\r\nOn 3.1.2:\r\n\r\n\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: macos\r\n * Matplotlib version: 3.2.1\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): pylab inline\r\n * Python version: na\r\n * Jupyter version (if applicable): na\r\n * Other libraries: na\r\n","author":{"url":"https://github.com/mwaskom","@type":"Person","name":"mwaskom"},"datePublished":"2020-05-16T12:49:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/17431/matplotlib/issues/17431"}
| 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:9ba4f8ef-4f67-f79b-82c5-b60c3d986162 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 835A:30EA87:2773B90:3940AD8:6A565A7A |
| html-safe-nonce | ac2d4c24236cc5af5dc3aea065dc8b7bdadcbce3dfdb379f478f10ac278ba0e4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MzVBOjMwRUE4NzoyNzczQjkwOjM5NDBBRDg6NkE1NjVBN0EiLCJ2aXNpdG9yX2lkIjoiMzA2NjQ2MTU2MjgzNzgxNzk3OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 28affb8b31f1f7a47d997ff0c97852acce1584a83e3630acfa967592aaea25c2 |
| hovercard-subject-tag | issue:619466785 |
| 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/17431/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c0de68040a4a123e4acde6a579a413b13f54060c3f8f27be82155a905bbedd95/matplotlib/matplotlib/issues/17431 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c0de68040a4a123e4acde6a579a413b13f54060c3f8f27be82155a905bbedd95/matplotlib/matplotlib/issues/17431 |
| og:image:alt | Bug report Bug summary In 3.2, scatter is color-mapping 4 points when the c input is 2D with shape (1, 4). This is a change from 3.1. The docs for scatter say Note that c should not be a single num... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mwaskom |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6a3afe34dff341ad10912db44becf282289d7f2af20576241738530fbb28de01 |
| 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 | b71002134df95575e9f6c2945a64d454b0be181e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width