Title: Plotting three points using scatter results in wrong color - 1.4.3 · Issue #5377 · matplotlib/matplotlib · GitHub
Open Graph Title: Plotting three points using scatter results in wrong color - 1.4.3 · Issue #5377 · matplotlib/matplotlib
X Title: Plotting three points using scatter results in wrong color - 1.4.3 · Issue #5377 · matplotlib/matplotlib
Description: I'm running this on Windows 10 / Anaconda Python 3.4.3 / jupyter iPython 4 Here's some repro code: import matplotlib.pyplot as plt import numpy as np fig = plt.figure(1) ax = plt.axes([0., 0., 1., 1.]) points = np.random.rand(2,2) # plot...
Open Graph Description: I'm running this on Windows 10 / Anaconda Python 3.4.3 / jupyter iPython 4 Here's some repro code: import matplotlib.pyplot as plt import numpy as np fig = plt.figure(1) ax = plt.axes([0., 0., 1., ...
X Description: I'm running this on Windows 10 / Anaconda Python 3.4.3 / jupyter iPython 4 Here's some repro code: import matplotlib.pyplot as plt import numpy as np fig = plt.figure(1) ax = plt.axes([0., ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/5377
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Plotting three points using scatter results in wrong color - 1.4.3","articleBody":"I'm running this on Windows 10 / Anaconda Python 3.4.3 / jupyter iPython 4\r\n\r\nHere's some repro code:\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\nfig = plt.figure(1)\r\nax = plt.axes([0., 0., 1., 1.])\r\n\r\npoints = np.random.rand(2,2) # plot 2 points, totally fine\r\nax.scatter(points[0], points[1], c=[1, 0, 0], s=200)\r\npoints = np.random.rand(2,3) # plot 3 points, hopelessly broken\r\nax.scatter(points[0], points[1], c=[0, 1, 0], s=200)\r\npoints = np.random.rand(2,3) # plot 3 points with string color, totally ok\r\nax.scatter(points[0], points[1], c='g', s=200)\r\npoints = np.random.rand(2,4) # plot 4 points, totally fine\r\nax.scatter(points[0], points[1], c=[0, 0, 1], s=200)\r\nplt.show()\r\n```\r\n\r\nHere's what I get:\r\n\r\n\r\n\r\nAs you can see, plotting 2, 4, or any other number of points using `ax.scatter` is fine, but graphing 3 points while using RGB color array results in two points as black, and one point as white, instead of using the specified color.\r\n\r\nHere's an example on a real dataset. As you can see, it also messes with the legend color. It's hard to diagnose the issue because it's completely non-obvious that the number of points plotted is what triggers the bug.\r\n\r\n\r\nI was pulling my hair out for awhile until I realized that the problem only manifested itself on series that had 3 members.\r\n","author":{"url":"https://github.com/liujimj","@type":"Person","name":"liujimj"},"datePublished":"2015-11-02T06:31:01.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":16},"url":"https://github.com/5377/matplotlib/issues/5377"}
| 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:f27ac09a-1909-c16c-db2b-d8772f71bb73 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9194:338773:429D0D7:5E1B956:6A56D360 |
| html-safe-nonce | 61d1693c724e4ad196b679ef7574554f7085357df4a5743a74e65540ee2ea91d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MTk0OjMzODc3Mzo0MjlEMEQ3OjVFMUI5NTY6NkE1NkQzNjAiLCJ2aXNpdG9yX2lkIjoiMTI1NTk3MzE4MjE2NDYyMDEyOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b2d2ab70ae4aa2b4f3b860840314ec7a32ec5a5480baf9f156b88ac1fd309fde |
| hovercard-subject-tag | issue:114534698 |
| 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/5377/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a4bb3e3057d1920e0f2c62a29d057ec699a3f9d6ea4e951bf8ea22c17cf97edd/matplotlib/matplotlib/issues/5377 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a4bb3e3057d1920e0f2c62a29d057ec699a3f9d6ea4e951bf8ea22c17cf97edd/matplotlib/matplotlib/issues/5377 |
| og:image:alt | I'm running this on Windows 10 / Anaconda Python 3.4.3 / jupyter iPython 4 Here's some repro code: import matplotlib.pyplot as plt import numpy as np fig = plt.figure(1) ax = plt.axes([0., 0., 1., ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | liujimj |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5220a278731283038daf0ed00b41f06ef7ff9539020ecc806c5c5a0fb6bda25a |
| 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 | 952dc124c1d105aa6fc49def04bb458db95747d7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width