简体   繁体   English

旋转标签以在R中绘制散点图

[英]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? 我知道如何使用“文本”命令向R中的散点图中的点添加标签,如以下问题所示: 如何在此散点图中标记点?

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)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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