Title: Feature Request: Allow hexbin to use a string for parameter C to refer to column in data (DataFrame) · Issue #18097 · matplotlib/matplotlib · GitHub
Open Graph Title: Feature Request: Allow hexbin to use a string for parameter C to refer to column in data (DataFrame) · Issue #18097 · matplotlib/matplotlib
X Title: Feature Request: Allow hexbin to use a string for parameter C to refer to column in data (DataFrame) · Issue #18097 · matplotlib/matplotlib
Description: Feature request Currently the hexbin function allows for its first two parameters x and y to be strings of data (usually a pandas DataFrame), but not C import numpy as np import pandas as pd import matplotlib.pyplot as plt df = pd.DataFr...
Open Graph Description: Feature request Currently the hexbin function allows for its first two parameters x and y to be strings of data (usually a pandas DataFrame), but not C import numpy as np import pandas as pd import...
X Description: Feature request Currently the hexbin function allows for its first two parameters x and y to be strings of data (usually a pandas DataFrame), but not C import numpy as np import pandas as pd import...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/18097
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Feature Request: Allow hexbin to use a string for parameter C to refer to column in data (DataFrame)","articleBody":"\u003c!--To help us understand and resolve your issue, please fill out the form to the best of your ability.--\u003e\r\n\u003c!--You can feel free to delete the sections that do not apply.--\u003e\r\n\r\n### Feature request\r\n\r\nCurrently the `hexbin` function allows for its first two parameters `x` and `y` to be strings of `data` (usually a pandas DataFrame), but not `C`\r\n\r\n```python\r\nimport numpy as np\r\nimport pandas as pd\r\nimport matplotlib.pyplot as plt\r\ndf = pd.DataFrame(np.random.rand(100000, 3))\r\ndf.columns = ['a', 'b', 'c']\r\nplt.hexbin('a', 'b', C='c', data=df)\r\n```\r\n\r\nResults in `IndexError: string index out of range`\r\n\r\nCurrently, you must pass in `C` as a Series/array\r\nplt.hexbin('a', 'b', C=df['c'], data=df)\r\n\r\n\r\n\r\n","author":{"url":"https://github.com/tdpetrou","@type":"Person","name":"tdpetrou"},"datePublished":"2020-07-28T14:24:22.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/18097/matplotlib/issues/18097"}
| 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:85266584-d7d1-bcee-1125-bce87168b926 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9B8E:B6D9A:130A9E2:1976FCE:6A52A77C |
| html-safe-nonce | dfc724cec62ac01720acf9ded1bbea2c17875766bf179c68d54a665ea43e3c6a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjhFOkI2RDlBOjEzMEE5RTI6MTk3NkZDRTo2QTUyQTc3QyIsInZpc2l0b3JfaWQiOiI2NDA0MzYyNTA1Nzg3OTc1NTQ4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 29a65306b9f36712653e0152f22c82d83ed75893be1da94f62bf39c3d1b6fca3 |
| hovercard-subject-tag | issue:667117093 |
| 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/18097/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c40d037815a690a29957c9e4b573d2459e4b3866fe46f44b7294fd05b0027c33/matplotlib/matplotlib/issues/18097 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c40d037815a690a29957c9e4b573d2459e4b3866fe46f44b7294fd05b0027c33/matplotlib/matplotlib/issues/18097 |
| og:image:alt | Feature request Currently the hexbin function allows for its first two parameters x and y to be strings of data (usually a pandas DataFrame), but not C import numpy as np import pandas as pd import... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tdpetrou |
| 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