Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
2 views
in R Programming by (47.6k points)
How can I label points in ggplot?

1 Answer

0 votes
by (106k points)

You can use geom_text, with aes label. You can also use hjust, vjust to adjust text position.

Below is the code for the same:-

ggplot(nba, aes(x= MIN, y= PTS, colour="green", label=Name))+geom_point() +geom_text(aes(label=Name),hjust=0, vjust=0)

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...