I have the following example data:
d <- data.frame(x = 1:3, y = 1:3, category = letters[1:3], p = c(TRUE, TRUE, FALSE))
I'd like to plot this coloring by category.
ggplot(d, aes(x, y, color = category) + geom_point(shape = "circle filled")
Then I'd like to make the fill:
- the same as the category if
pisTRUE - white otherwise
ggplot(d, aes(x, y, color = category, fill = ???) + geom_point(shape = "circle filled")
Has anyone any suggestions?
Could I
- access the color scale results and then manipulate them?
- calculate color and fill manually, but still have the same legend labels?
