plotly / plotly/plotly.R

Plotly rounding timestamps with milliseconds to nearest second

Open
#1,753 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
R
Stars
2.7k
Forks
641
PR merge metrics
No merged PRs in 30d

Description

When plotting a time-series with milliseconds, Plotly rounds the data on the x-axis to the nearest second.

x <- seq(1, 10000, by=250)/1000
y <- 1:length(x)
x <- as.POSIXct(x, origin='1970-01-01', tz='UTC')
data <- data.frame(x, y)
plot_ly(data, x=~x, y=~y, type='scatter', mode='lines+markers')

See another example here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the reproducible R example in the issue and compare the plotted x-axis with the millisecond timestamps in the input data. Trace the timestamp handling used by plot_ly for scatter plots; done means timestamps retain millisecond precision instead of being rounded to whole seconds.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.