-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviorguides π
Milestone
Description
I noticed that if I use fill with geom_point I have to manually set the shape of the legend point to make the fill color visible
library(ggplot2)
set.seed(42)
d <- data.frame(x = rnorm(12), y = rnorm(12),
shape = rep(LETTERS[1:4], each = 3),
fill = rep(letters[1:3], 4))
ggplot(d, aes(x = x, y = y, shape = shape, fill = fill)) +
geom_point(size = 3) +
scale_shape_manual(values = 21:25) +
theme(legend.box = "horizontal")ggplot(d, aes(x = x, y = y, shape = shape, fill = fill)) +
geom_point(size = 3) +
scale_shape_manual(values = 21:25) +
guides(fill = guide_legend(override.aes=list(shape=21))) +
theme(legend.box = "horizontal")It seems to be reasonable to change the default behavior in such cases, because it is not obvious and requires search for a solution over the internet.
DagHjermann
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviorguides π

