When we have both the shape and the color legend in the scatter chart, the shape of the color legend is misleading:
foo <- data.frame( length=runif(10), height=runif(10), group=as.factor(sample(3,10,rep=T)), quality=as.factor(sample(2,10,rep=T)) ) ggplot(foo, aes(x = length, y = height, color=group, shape=quality)) + geom_point(size=5)
This will create a graph below. As you can see, the βcircleβ shape is reserved for quality==1 objects, however, in the group legend, all 3 groups are represented as a circle - with different colors, this can be misleading.
It would be much better if the group legend was represented by a form that has not yet been reserved for a specific purpose, for example, to fill the entire legend element with a specific color.
Do you have any simple idea how to solve this?

source share