Title: Coloring by boolean column type does not work · Issue #2121 · plotly/plotly.py · GitHub
Open Graph Title: Coloring by boolean column type does not work · Issue #2121 · plotly/plotly.py
X Title: Coloring by boolean column type does not work · Issue #2121 · plotly/plotly.py
Description: When trying to color a scatter plot by a bool column datatype, the colors do not show: (see attached file for data) grouped.dtypes mean_ape float64 measurement_type object note object parameters object n_estimators int64 max_depth int64 ...
Open Graph Description: When trying to color a scatter plot by a bool column datatype, the colors do not show: (see attached file for data) grouped.dtypes mean_ape float64 measurement_type object note object parameters ob...
X Description: When trying to color a scatter plot by a bool column datatype, the colors do not show: (see attached file for data) grouped.dtypes mean_ape float64 measurement_type object note object parameters ob...
Opengraph URL: https://github.com/plotly/plotly.py/issues/2121
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Coloring by boolean column type does not work","articleBody":"When trying to color a scatter plot by a `bool` column datatype, the colors do not show:\r\n\r\n(see attached file for data)\r\n\r\n```\r\ngrouped.dtypes\r\n\r\nmean_ape float64\r\nmeasurement_type object\r\nnote object\r\nparameters object\r\nn_estimators int64\r\nmax_depth int64\r\nbootstrap bool\r\nmax_features float64\r\n\r\nfig = px.scatter(\r\n grouped,\r\n x=\"n_estimators\",\r\n y=\"mean_ape\",\r\n facet_row=\"measurement_type\",\r\n color=\"bootstrap\",\r\n title=\"Error vs Number of Estimators Colored by Bootstrap\",\r\n height=1000, width=1600\r\n)\r\n```\r\n\u003cimg width=\"1433\" alt=\"Screen Shot 2019-06-17 at 08 52 13 EDT\" src=\"https://user-images.githubusercontent.com/17484616/59605663-45849600-90dd-11e9-898b-155736577bb6.png\"\u003e\r\n\r\nHowever, if I convert the `bool` column to a `str`, then the colors correctly appear:\r\n\r\n```\r\nnew_grouped = grouped.copy()\r\nnew_grouped['bootstrap'] = new_grouped['bootstrap'].astype(str)\r\n\r\nfig = px.scatter(\r\n new_grouped,\r\n x=\"n_estimators\",\r\n y=\"mean_ape\",\r\n facet_row=\"measurement_type\",\r\n color=\"bootstrap\",\r\n title=\"Error vs Number of Estimators Colored by Bootstrap\",\r\n height=1000, width=1600\r\n)\r\n```\r\n\r\n\u003cimg width=\"1441\" alt=\"Screen Shot 2019-06-17 at 08 53 13 EDT\" src=\"https://user-images.githubusercontent.com/17484616/59605745-6e0c9000-90dd-11e9-95d4-9ecd24e20b24.png\"\u003e\r\n\r\n[grouped.csv.zip](https://github.com/plotly/plotly_express/files/3297037/grouped.csv.zip)\r\n\r\n","author":{"url":"https://github.com/WillKoehrsen","@type":"Person","name":"WillKoehrsen"},"datePublished":"2019-06-17T12:56:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/2121/plotly.py/issues/2121"}
| 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:0676ae91-66cb-82b1-7785-2c6a8b4745dc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E768:1AC24:3D3E631:56E2EC0:6A56B76E |
| html-safe-nonce | 4fde74ee03a668c1c17ff114f0438a23df8d43b598fe7aa028e42bf51a98fee5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzY4OjFBQzI0OjNEM0U2MzE6NTZFMkVDMDo2QTU2Qjc2RSIsInZpc2l0b3JfaWQiOiIyMzcxNDcyNzY1NTcwNDMwODMwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d6b141fb502e9cae9a9f4c818849395f40c12563536a43bb7ff0a3d7a55fa917 |
| hovercard-subject-tag | issue:554506035 |
| 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/plotly/plotly.py/2121/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c2d4feb869785584653e34e09c2bfb13682c70cc4c1986d99db7bab92e9fff93/plotly/plotly.py/issues/2121 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c2d4feb869785584653e34e09c2bfb13682c70cc4c1986d99db7bab92e9fff93/plotly/plotly.py/issues/2121 |
| og:image:alt | When trying to color a scatter plot by a bool column datatype, the colors do not show: (see attached file for data) grouped.dtypes mean_ape float64 measurement_type object note object parameters ob... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | WillKoehrsen |
| hostname | github.com |
| expected-hostname | github.com |
| None | df99b7164e1d961b639cf5d3cbd6b5ba673edc67bd7e47cdc4746b96099e11ae |
| turbo-cache-control | no-preview |
| go-import | github.com/plotly/plotly.py git https://github.com/plotly/plotly.py.git |
| octolytics-dimension-user_id | 5997976 |
| octolytics-dimension-user_login | plotly |
| octolytics-dimension-repository_id | 14579099 |
| octolytics-dimension-repository_nwo | plotly/plotly.py |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 14579099 |
| octolytics-dimension-repository_network_root_nwo | plotly/plotly.py |
| 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 | c29ba03b1896083dbe1084f6cd1c5367d8a0d67c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width