Skip to content

Time series plot x range starts from 1970 #1653

Open
@MohoWu

Description

@MohoWu

When I'm trying to plot a time series coloured by the value of variable, the date range starts from 1970. It defaults to a sensible date if I exclude the color argument. I can certainly manually specify the xaxis range, but when I double click the plot to reset the scale it goes back to the 1970 range again, which is quite annoying.

library(lubridate)
library(plotly)

data <- data.frame(date = seq(from = ymd_hms("20190101 000000"), 
                              to = ymd_hms("20190301 000000"), 
                              by = "1 hour"),
                   y = round(runif(1417, 0, 10)))

data %>%
  plot_ly(x = ~date, y = ~y, color = ~y) %>%
  add_markers()

newplot

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions