Support more than 6 shapes for geom_point()
hsiaoyi0504 opened this issue · 3 comments
More than 6 shapes will be empty in the current implementation
library(ggplot2)
m <- matrix(rnorm(20) , nrow = 10)
m <- as.data.frame(m)
colnames(m) <- c("x", "y")
m$num <- as.character(1:nrow(m))
ggplot(m, aes(x, y, shape=num)) +
geom_point()
Similar issue discussed on StackOverflow: https://stackoverflow.com/questions/26223857/more-than-six-shapes-in-ggplot
I believe you also likely received a warning message with that code that strongly suggests that this limitation is not an oversight but a conscious design decision on the part of the ggplot2 authors. The fact that this was a deliberate choice might influence how one goes about making an argument to reverse it.
From the documentation:
If you have more than six levels, you will get a warning message, and the seventh and subsequent levels will not appear on the plot. Use
scale_shape_manual()
to supply your own values.
I suspect the reason this is how it's implemented is that using that many different shapes will typically create terrible plots that we want to discourage that. So if you really need (want) more than six shapes you have to specify them manually.
I agree with Joran and Claus. I think the current behaviour is aligned with the philosophy that we'd like it to be easy to do the good thing and harder, but not impossible, to do less good things. That said, ggplot2 fully supports >6 shapes as long as you give an appropriate palette. It is the default shape palette defined in the {scales} package that doesn't support it. For these reasons, I'll close this issue.