Is there a way to add factor label on top of points in the scatterplot with ggplot?
Take iris dataset, for example (unique rows).
iris_unique <- unique(iris)
Species column is a factor with 3 levels. I can make a scatterplot out of sepal.length vs sepal.width:
ggplot(iris_unique, aes(x=Sepal.Length, y=Sepal.Width, col=Species)) +
geom_point(size = 3)+
theme_bw()
and I need a way to place the label above the 3 different regions, indicating which factor level they belong to.
For few levels color sufficies but I am normally handling datasets with cca. 20 factor levels and color is useless to indicate different ones on the scatterplot. If there was a way to add text label to the graph (not to each dot, but one label per factor level hovering roughly above the corresponding dot region), it would still work in conveying the message, I think.
Thank you all in advance!