I have a data frame with more than 40 factor levels and I would like to assign different shapes for each level. However, as shown in the scale_shapes_table of ggplot2<
Would using a combination of 5 or 10 distinct shapes with distinct colors sufficient to distinguish the 40 points work better? I see these as being visually easier to differentiate the 40 elements than using/resorting to unusual symbols.
ggplot(data=data,aes(x=x1,y=y1, shape=factor(gr), col=factor(gr)))+
geom_point(alpha = 0.5, size=4, stroke=1.4) +
scale_shape_manual(values=rep(c(0:2,5:6,9:10,11:12,14), times=4))
Or take advantage of the 5 unique shapes that take fill colors.
ggplot(data=data,aes(x=x1,y=y1, shape=factor(gr), fill=factor(gr), col=factor(gr)))+
geom_point(alpha = 0.5, size=4, stroke=1.4) +
scale_shape_manual(values=rep(c(21:25), times=8))