Skip to content

scatter plots with datetime x-axis and more than 1000 data points do not render all points #4298

Closed
@cprice404

Description

@cprice404

I believe this issue is similar to plotly/plotly_express#145 .

I am using plotly 5.15.0 in jupyter lab 3.6.3.

My browsers (have tried firefox and chrome) support webgl.

When I render a scatter plot where the x-axis values are datetime objects,

if the plot has 1000 points, it renders fine:

size = 1000
x = np.random.randint(1690332167190, 1690332667190, size=size)
y = np.random.randint(0, 10000, size=size)
df = pd.DataFrame()
df['x'] = pd.to_datetime(x, unit='ms')
df['y'] = y
fig = px.scatter(df, x='x', y='y')
fig

image

but if I change size to 1001, the render only shows a few clusters of values on the x-axis:

image

the hover/mouseover behavior makes it clear that there are a bunch of points that exist in the spaces between what is plotted on the graph:

image

but the individual points don't render (or are rendered with the wrong x-value, not sure which).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions