Skip to content

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

Closed

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

Activity

  1. AaronStiff commented on Feb 22, 2023

    @AaronStiff
    Contributor

    This is indeed a bug. However, a workaround would be to use plotly.express as the issue is not present there.

  2. self-assigned this
    on Jul 5, 2024
  3. removed their assignment
    on Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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