Skip to content

Instantly share code, notes, and snippets.

@jvieroe
Created March 28, 2022 08:36
Show Gist options
  • Save jvieroe/48bc41c88ee7c0c47748b2d9fa19d117 to your computer and use it in GitHub Desktop.
Save jvieroe/48bc41c88ee7c0c47748b2d9fa19d117 to your computer and use it in GitHub Desktop.
ggplot date axis
df <- tibble(date = c("06-10-2021", "07-10-2021"),
y = c(1, 2))
df %<>%
mutate(date = lubridate::dmy(date))
df %>%
ggplot(., aes(x = date, y = y)) +
geom_point()
df %>%
ggplot(., aes(x = date, y = y)) +
geom_point() +
scale_x_date(date_labels = "%d %B")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment