Title: plotly express scatterplots not displaying correctly in jupyter · Issue #4154 · plotly/plotly.py · GitHub
Open Graph Title: plotly express scatterplots not displaying correctly in jupyter · Issue #4154 · plotly/plotly.py
X Title: plotly express scatterplots not displaying correctly in jupyter · Issue #4154 · plotly/plotly.py
Description: I have an issue with larger scatterplots not displaying correctly. I am using jupyter on a Mac M1 and both using it from vs code and from jupyter-lab have the same issue (or I might be doing something wrong) When displaying 1000 points i...
Open Graph Description: I have an issue with larger scatterplots not displaying correctly. I am using jupyter on a Mac M1 and both using it from vs code and from jupyter-lab have the same issue (or I might be doing someth...
X Description: I have an issue with larger scatterplots not displaying correctly. I am using jupyter on a Mac M1 and both using it from vs code and from jupyter-lab have the same issue (or I might be doing someth...
Opengraph URL: https://github.com/plotly/plotly.py/issues/4154
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"plotly express scatterplots not displaying correctly in jupyter","articleBody":"I have an issue with larger scatterplots not displaying correctly. I am using jupyter on a Mac M1 and both using it from vs code and from jupyter-lab have the same issue (or I might be doing something wrong)\r\n\r\nWhen displaying 1000 points it works as I expect but as soon as I get over 1000 points the x-values is not correct any more\r\n\r\n```python\r\nimport pandas as pd\r\nimport plotly\r\nimport plotly.express as px\r\nimport plotly.graph_objects as go\r\nimport random\r\nimport datetime\r\n\r\ndf = pd.DataFrame(columns=['metric', 'value', 'time'])\r\nfor i in range(1001):\r\n df = pd.concat([df, pd.DataFrame({'metric': random.choice(['a', 'b', 'c', 'd', 'e']), \r\n 'value': random.random()*20, \r\n 'time': datetime.datetime.now() + datetime.timedelta(seconds=random.randint(1, 300))}, index=[0])],\r\n ignore_index=True)\r\nprint(df.info())\r\nprint(\"Plotly version\", plotly.__version__)\r\nprint(\"Pandas version\", pd.__version__)\r\nfig1 = px.scatter(df.head(1000), x=\"time\", y=\"value\", title=\"Durations\", color='metric')\r\nfig2 = px.scatter(df, x=\"time\", y=\"value\", title=\"Durations\", color='metric')\r\nfig1.show()\r\nfig2.show()\r\n```\r\n\r\nWill have the output:\r\n```\r\n\u003cclass 'pandas.core.frame.DataFrame'>\r\nRangeIndex: 1001 entries, 0 to 1000\r\nData columns (total 3 columns):\r\n # Column Non-Null Count Dtype \r\n--- ------ -------------- ----- \r\n 0 metric 1001 non-null object \r\n 1 value 1001 non-null float64 \r\n 2 time 1001 non-null datetime64[ns]\r\ndtypes: datetime64[ns](1), float64(1), object(1)\r\nmemory usage: 23.6+ KB\r\nNone\r\nPlotly version 5.14.1\r\nPandas version 2.0.0\r\n```\r\nand the plots\r\n1000 points\r\n\u003cimg width=\"1289\" alt=\"image\" src=\"https://user-images.githubusercontent.com/93670175/230558741-ba57d556-4d45-4c07-bb58-ced3ff18a771.png\">\r\n\r\nand 1001 points\r\n\u003cimg width=\"1281\" alt=\"image\" src=\"https://user-images.githubusercontent.com/93670175/230558798-58db08a2-c28d-4cb5-a354-5044c5911a5a.png\">\r\n\r\nother information of value is that the hoover data is triggered in the correct place so when i hover empty space i get the correct popup\r\n\u003cimg width=\"1271\" alt=\"image\" src=\"https://user-images.githubusercontent.com/93670175/230558917-031cc7d1-472c-4364-bb7f-c0e425f79736.png\">\r\n\r\nif i do it using go figures it works as expected\r\n```python\r\nfig = go.Figure()\r\nfor metric, group in df.groupby(\"metric\"):\r\n fig.add_trace(go.Scatter(x=group['time'], y=group['value'], mode='markers', name=metric))\r\nfig.show()\r\n```\r\n\u003cimg width=\"1247\" alt=\"image\" src=\"https://user-images.githubusercontent.com/93670175/230560001-8c9e7922-259a-42a3-8776-4e6c01e8b64e.png\">\r\n\r\n\r\n","author":{"url":"https://github.com/OlovJ","@type":"Person","name":"OlovJ"},"datePublished":"2023-04-07T07:01:10Z","url":"https://github.com/plotly/plotly.py/issues/4154"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:38a5c2c5-b0bb-4512-e549-01f568be18b8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9096:31E99C:2E1CF93:3D89EB3:6B01D884 |
| html-safe-nonce | 3033e6267bf0f5894e710333e5528bf0aaafe5809779a15cc91fca21b23d0ddd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDk2OjMxRTk5QzoyRTFDRjkzOjNEODlFQjM6NkIwMUQ4ODQiLCJ2aXNpdG9yX2lkIjoiODQxOTgyODA5MzMwMDEwMzMwMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 065b648dd66c2ccd064f73b1b0d3284978803d9273f9555b5fd306127923c452 |
| hovercard-subject-tag | issue:1658452660 |
| 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/4154/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3773d8a35c88c22fb0a40ebf4000ca1a17f3cdf862df793e4e5665b03f8427e5/plotly/plotly.py/issues/4154 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3773d8a35c88c22fb0a40ebf4000ca1a17f3cdf862df793e4e5665b03f8427e5/plotly/plotly.py/issues/4154 |
| og:image:alt | I have an issue with larger scatterplots not displaying correctly. I am using jupyter on a Mac M1 and both using it from vs code and from jupyter-lab have the same issue (or I might be doing someth... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | OlovJ |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width