Skip to content
Prev 387451 / 398502 Next

How to plot dates

Hello,

I don't really understand what is to be plotted, just the time of the 
event? But what event?

Anyway, with the data read with Sarah's code, maybe


library(ggplot2)

ggplot(myDat, aes(x = datetime, y = 1)) +
   geom_linerange(aes(ymin = 0, ymax = 1), linetype = "dotted") +
   geom_point() +
   scale_x_datetime(breaks = myDat$datetime) +
   scale_y_continuous(labels = NULL) +
   ylab("event") +
   theme(axis.text.x = element_text(angle = 60, vjust = 1, hjust=1),
         axis.ticks.y = element_blank())


Hope this helps,

Rui Barradas

?s 13:36 de 16/03/21, Sarah Goslee escreveu: