Skip to content

POSIX.ct values are truncated to whole seconds #460

@joshmyzie2

Description

@joshmyzie2

I often plot high-frequency market data, so I would like to be able to zoom in to see the sub-second time-scale.

Plotly would be perfect for this, but I noticed that it truncates all timestamps (POSIX.ct type) to the nearest whole second. I even tried setting "options(digits.secs=6)", but that didn't seem to help.

Example:
ggplotly(ggplot(data.frame(x=Sys.time()+1e-3*c(1:9,5000), y=rnorm(10)), aes(x,y)) + geom_point())

You can either zoom in to see that the first 9 points are all plotted on the same x-value or just look at the html source.

Note that the reason for the 10th point is to avoid this (probably unrelated) bug when using ggplot2 with small time intervals:
r-lib/scales#65

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