简体   繁体   中英

rotate the labels for a scatter plot in R

I know how to add labels to points in a scatter plot in R using the "text" command, as shown in this question: How can i label points in this scatterplot?

But how can I rotate the text lable so that it runs vertically from the point?

像这样吗

ggplot(mtcars, aes(wt, mpg, label = rownames(mtcars))) + geom_point() + geom_text(angle=90,hjust=1.2)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM