Skip to content

Incorrect handling of np.datetime64[ns] date values #3957

@taldcroft

Description

@taldcroft

Dates specified using numpy datetime64 with [ns] precision are handled incorrectly in plotting. Dates with microsec [us] precision or lower work as expected.

t0 = np.datetime64("2022-10-20T00:00:00").astype("datetime64[ns]")
t1 = np.datetime64("2022-10-21T00:00:00").astype("datetime64[ns]")

fig = go.Figure()
fig.add_trace(go.Scatter(x=[t0, t1], y=[3, 4], mode="lines"))
fig.show()

newplot

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions