MattCowgill / ggannotate

Interactively annotate ggplots
Other
309 stars 20 forks source link

ggannotate fails when x is datetime #50

Open matiasandina opened 1 year ago

matiasandina commented 1 year ago

The error I get is "Error: Invalid input: time_trans works with objects of class POSIXct only"

I did get the proper code though (lubridate::as_datetime() added by me to make it work)

  geom_curve(data = data.frame(x = lubridate::as_datetime(1691077324.05326),
                               y = 222.017858130503, 
    xend = lubridate::as_datetime(1691071613.9407),
    yend = 22.6778110317712), 
    mapping = aes(x = x, y = y, xend = xend, yend = yend), 
    arrow = arrow(30L, unit(0.1, "inches"), "last", "closed"), inherit.aes = FALSE)