Sorry - I know this is not a bug, but I'd like your opinion on it anyway. The reprex below shows how I would use geom_circle to draw a circle around some but not all geom_point. As far as I know, the legend will always show a rectanlge around the symbols, yet it would be nice if it would actually be a circle. I don't think I can approach this with guide() or theme(legend.key = ). Can you think of a solution?
library(ggforce)
dat <- data.frame(
x = c(1, 1.3, 1.6),
y = c(1, 1, 1),
circle = c("yes", "no", "no")
)
ggplot() +
coord_equal() +
theme_classic() +
geom_circle(
data = subset(dat, circle == "yes"),
aes(x0 = x, y0 = y, r = 0.5, alpha = circle),
fill = "grey",
color = NA,
show.legend = TRUE
) +
geom_point(
data = dat,
aes(x, y, color = circle)
) +
scale_color_manual(
values = c("yes" = "blue", "no" = "red")
) +
scale_alpha_manual(
values = c("yes" = 0.25, "no" = 0)
)
Sorry - I know this is not a bug, but I'd like your opinion on it anyway. The reprex below shows how I would use
geom_circle
to draw a circle around some but not allgeom_point
. As far as I know, the legend will always show a rectanlge around the symbols, yet it would be nice if it would actually be a circle. I don't think I can approach this withguide()
ortheme(legend.key = )
. Can you think of a solution?Created on 2022-07-21 by the reprex package (v2.0.1)