I have ggplot2 v321 and when trying to change background color I got the following error:
Error in element_rect(fill = "green") :
could not find function "element_rect"
when doing:
plot <- df %>% ggplot2::ggplot(ggplot2::aes(x = x, y = y, color=color)) +
ggplot2::geom_point(alpha = 0.1, size = 0, shape = 20) +
ggplot2::theme(legend.position = "none",
plot.background = element_rect(fill = "green"))
Do anyone know this error?
thanks