Calendar coordinates

coord_calendar(
  period = "week",
  time = "x",
  xlim = NULL,
  ylim = NULL,
  expand = TRUE,
  default = FALSE,
  clip = "on",
  coord = coord_cartesian()
)

Examples


library(ggplot2)
x <- 1:100
p <- tibble::tibble(
  time = Sys.time() + x*3600,
  sin = sin(x/pi)
) |>
  ggplot(aes(x = time, y = sin)) +
  geom_line()

p

p + coord_calendar(coord=coord_cartesian())

p + coord_calendar(coord=coord_polar())
#> Error in geom_line(): Problem while converting geom to grob.
#>  Error occurred in the 1st layer.
#> Caused by error in `transform()`:
#> ! attempt to apply non-function