【问题标题】:rotate the labels for a scatter plot in R旋转R中散点图的标签
【发布时间】:2017-10-26 08:48:06
【问题描述】:

我知道如何使用“文本”命令为 R 中散点图中的点添加标签,如以下问题所示:How can i label points in this scatterplot?

但是如何旋转文本标签以使其从该点垂直运行?

【问题讨论】:

  • 在基本 R 图形中,text(..., srt = 90) 将文本旋转 90 度。
  • 非常感谢,我错过了帮助中“par”设置可以在文本中使用的声明

标签: r


【解决方案1】:

这样的?

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-10-06
    • 1970-01-01
    • 2021-09-17
    • 1970-01-01
    • 1970-01-01
    • 2017-07-10
    • 2013-08-09
    • 1970-01-01
    相关资源
    最近更新 更多