-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
y-axis values are displayed in ascending order in scatter plots, version 6.0.1 #5099
Comments
Full pip freeze:
|
And python version |
@sstripps1 I haven't been able to reproduce the issue so far with Plotly 6.0.1 and the code snippet below. I'd like to get to the bottom of this though -- can you share a self-contained code example, or code + CSV? It looks to me like what's happening in your chart above is for some reason the index column of the dataframe is being used for the y-values instead of import plotly.graph_objects as go
import pandas as pd
daily_views = pd.DataFrame({
"viewed_date": ["2025-02-20", "2025-02-21", "2025-02-24", "2025-02-25", "2025-02-26", "2025-02-27", "2025-02-28", "2025-03-04", "2025-03-05", "2025-03-06", "2025-03-07", "2025-03-10", "2025-03-12", "2025-03-13", "2025-03-17"],
"view_count": [2, 14, 2, 2, 3, 6, 2, 1, 5, 7, 1, 1, 6, 2, 1],
"cumulative_views": [2, 16, 18, 20, 23, 29, 31, 32, 37, 44, 45, 46, 52, 54, 55],
})
fig = go.Figure()
fig.add_scatter(
x=daily_views["viewed_date"],
y=daily_views["view_count"],
mode="lines+markers",
name="Daily Views",
)
fig.show() |
I was able to replicate the issue by wrapping the figure in a However, upgrading to cc @emilykl |
I am creating a scatter plot in
plotly==6.0.1
using the following code and underlying data:But the resulting figure displays the y-axis values in ascending order:
The same result is seen on
6.0.0
. Downgrading to5.24.1
fixes the issue:The text was updated successfully, but these errors were encountered: