-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Description
data.frame(x = seq(0, 360, 20), y = 1:19) |>
ggplot2::ggplot() +
ggplot2::geom_point(
ggplot2::aes(x = x, y = y)
) +
ggplot2::coord_radial() +
ggplot2::geom_rug(
ggplot2::aes(y = NULL, x = x)
)Error in `ggplot2::geom_rug()`:
! Problem while converting geom to grob.
ℹ Error occurred in the 2nd layer.
Caused by error in `$<-.data.frame`:
! replacement has 0 rows, data has 19
Run `rlang::last_trace()` to see where the error occurred.
It might make sense for geom_rug() not to work with coord_radial(), but this isn't a helpful error message for a user.
For clarity, I only encountered this when writing a package function that can optionally return a radial plot - I wasn't really after putting a rug on a polar plot. But it was a strange error to debug!
The same code works fine with coord_cartesian().
Cheers!
Metadata
Metadata
Assignees
Labels
No labels