相关疑难解决方法(0)

如何在ggplot2的注释中保持对齐文本

我的例子是:

qplot(mtcars$mpg) + annotate(geom = "text", x = 30, y = 3, label = "Some text\nSome more text")
Run Code Online (Sandbox Code Playgroud)

如何让这里的文字保持对齐?所以'有些人相互排队.

r annotate text-alignment ggplot2

75
推荐指数
1
解决办法
4万
查看次数

在ggplot2中旋转标签注释

我正在尝试旋转 R 中 ggplot 上的注释,类似于此问题,但使用带有背景的标签几何图形。

geom = "text"使用与或geom_text一起使用geom = 'label'的代码geom_label会导致注释不旋转。

fake = data.frame(x=rnorm(100), y=rnorm(100))
ggplot(data = fake, aes(x = x, y = y)) + 
    geom_point() +
    geom_vline(xintercept = -1, linetype = 2, color = "red") +
#    annotate(geom = "text", x = -1, y = -1, label = "Helpful annotation", color = "red",
#             angle = 90)
    annotate(geom = "label", x = -1, y = -1, label = "Helpful annotation", color …
Run Code Online (Sandbox Code Playgroud)

r ggplot2

0
推荐指数
1
解决办法
1398
查看次数

标签 统计

ggplot2 ×2

r ×2

annotate ×1

text-alignment ×1