Title: Path3DCollection.set_color(self, c) does not change the color of scatter points. · Issue #18386 · matplotlib/matplotlib · GitHub
Open Graph Title: Path3DCollection.set_color(self, c) does not change the color of scatter points. · Issue #18386 · matplotlib/matplotlib
X Title: Path3DCollection.set_color(self, c) does not change the color of scatter points. · Issue #18386 · matplotlib/matplotlib
Description: Bug report Bug summary I created a Path3DCollection from Axes.scatter(self). The Path3DCollection.set_color(self) method does not change the color of scatter points. Code for reproduction import numpy as np import matplotlib.pyplot as pl...
Open Graph Description: Bug report Bug summary I created a Path3DCollection from Axes.scatter(self). The Path3DCollection.set_color(self) method does not change the color of scatter points. Code for reproduction import nu...
X Description: Bug report Bug summary I created a Path3DCollection from Axes.scatter(self). The Path3DCollection.set_color(self) method does not change the color of scatter points. Code for reproduction import nu...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/18386
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Path3DCollection.set_color(self, c) does not change the color of scatter points.","articleBody":"### Bug report\r\n\r\n**Bug summary**\r\n\r\nI created a Path3DCollection from Axes.scatter(self). The Path3DCollection.set_color(self) method does not change the color of scatter points.\r\n\r\n**Code for reproduction**\r\n\r\n```python\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom matplotlib import animation\r\n\r\nnp.random.seed(1000)\r\nBLUE = \"#1f77b4\"\r\nYELLOW = \"#bcbd22\"\r\n\r\npoints = np.random.random_sample((1000, 3))\r\ncolors = lambda: list(YELLOW if np.random.random() \u003e 0.5 else BLUE for _ in points)\r\n\r\nfig = plt.figure()\r\nax = plt.axes(projection='3d')\r\npaths = ax.scatter(points[:,0], points[:,1], points[:,2])\r\ndef step(i):\r\n paths.set_color(colors())\r\n # paths.set_3d_properties(points[:,2], 'z') # Try uncommenting this line\r\n return paths\r\nanim = animation.FuncAnimation(fig, step, frames=200, interval=20)\r\nplt.show()\r\n```\r\n\r\n**Actual outcome**\r\n\r\nColors are static and do not change from initial.\r\n\r\n\r\nIf you run set_3d_properties(), then the colors do change, but I don't know how to use this function to leave the coordinates alone.\r\n\r\n\r\n**Expected outcome**\r\nThe magic of Christmas.\r\n\r\nThe points should not change in position like in the first image, but should change in color like in the second image.\r\n\r\n**Matplotlib version**\r\n * Operating system: macOS Catalina 10.15.6\r\n * Matplotlib version: 3.3.1\r\n * Matplotlib backend: MacOSX\r\n * Python version: 3.8.5 (default, Jul 21 2020, 10:48:26) [Clang 11.0.3 (clang-1103.0.32.62)]\r\n\r\nMatplotlib installed from pip\r\n\r\n","author":{"url":"https://github.com/QuocAnhVu","@type":"Person","name":"QuocAnhVu"},"datePublished":"2020-09-01T14:48:46.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/18386/matplotlib/issues/18386"}
| 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:a6ff8136-bbb8-5bff-3bc2-bc2ed30044f3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9320:215443:6F80A2:952918:6A530885 |
| html-safe-nonce | 0da0eb7e1d35c4790f3058550c0bd34308a581c22621c08521c0f704710d4cca |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzIwOjIxNTQ0Mzo2RjgwQTI6OTUyOTE4OjZBNTMwODg1IiwidmlzaXRvcl9pZCI6IjY0MjkxMDkyNTI2NDkwNjA0ODYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f76f880087bb8f3fa2511d79c0c1cfcdc19142c62ba48fb163d39429088bf7d5 |
| hovercard-subject-tag | issue:690206729 |
| 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/18386/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2196d2ee847bd85c3c24d3c4d577adbc06126767b8dd2047dd31b2908e5c87b6/matplotlib/matplotlib/issues/18386 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2196d2ee847bd85c3c24d3c4d577adbc06126767b8dd2047dd31b2908e5c87b6/matplotlib/matplotlib/issues/18386 |
| og:image:alt | Bug report Bug summary I created a Path3DCollection from Axes.scatter(self). The Path3DCollection.set_color(self) method does not change the color of scatter points. Code for reproduction import nu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | QuocAnhVu |
| 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