I want to highlight a certain text in a ggplot scatterplot. The code I have is here
library(ggplot2)
labels <- c("green", "blue", "orange", "blue", "green","red","purple","black")
num_1 <- c(1,2,3,4,5,6,7,8)
num_2 <- c(5,9,3,7,4,3,1,8)
df <- data.frame(labels,num_1,num_2)
p <- ggplot(df, aes(num_1,num_2,label=labels)) + geom_text()
p
For example, I want to highlight the text "green" by changing its font to bold or changing its color to yellow. Either works but I haven't been able to get it working. I've tried using gghighlight but haven't found a way to get it to work.


