【发布时间】:2016-05-23 03:26:27
【问题描述】:
我想将单个文本标签添加到 y 轴的指定点(称为 y = 1.5)。这将在其中以及常规滴答声中。
在 ggplot2 包中是否有这样做的好方法?
【问题讨论】:
-
使用
scale_y_continuous中的breaks参数来指定轴技巧必须在什么时候出现。
标签: r ggplot2 axis-labels
我想将单个文本标签添加到 y 轴的指定点(称为 y = 1.5)。这将在其中以及常规滴答声中。
在 ggplot2 包中是否有这样做的好方法?
【问题讨论】:
scale_y_continuous 中的breaks 参数来指定轴技巧必须在什么时候出现。
标签: r ggplot2 axis-labels
是的!来自ggplot2 documentation:
# Add a text annotation
p +
geom_text() +
annotate("text", label = "plot mpg vs. wt", x = 2, y = 15, size = 8, colour = "red")
(来源:ggplot2.org)
你的看起来像+ annotate("text", label = "your text here", x = 2, y = 1.5)
【讨论】: