I am trying to use geom_point
to illustrate the count of my data. I would also like to annotate a few of the points in my graph with geom_text
. When I add the call to geom_text
, it appears that it is plotting something underneath the points in the legend. I've tried reversing the order of the layers to no avail. I can't wrap my head around why it is doing this. Has anyone seen this before?
set.seed(42)
df <- data.frame(x = 1:10
, y = 1:10
, label = sample(LETTERS,10, replace = TRUE)
, count = sample(1:300, 10, replace = FALSE)
)
p <- ggplot(data = df, aes(x = x, y = y, size = count)) + geom_point()
p + geom_text(aes(label = label, size = 150, vjust = 2))