I must be obviously missing something simple, or this is a small bug. The geom_point () is always missing a plotting symbol when the shape=factor is used. This does not happen when color=factor is used. Appreciate your help. Here is a test code.
test <- data.frame(let=sample(LETTERS,7), id=c(1:7), y=c(id*7))
ggplot(data=test, aes(x=id, y=y))+
geom_point(aes(shape=let), size=6)
"Notice here the missing point (only 6 out 7) as one of the symbol is missing, which usually is alphabetically the last factor"
ggplot(data=test, aes(x=id, y=y))+
geom_point(aes(color=let), size=6)
"Here we see 7 points with different colors"
Thanks, VJ
That's because scales::shape_pal defines a maximum of 6 values; try adding scale_shape_manual(values=1:7)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With