在ggplot2中使用geom_label(),是否可以使矩形完全正方形而不是圆角?
data(iris)
ggplot(iris, aes(Sepal.Width, Sepal.Length)) + geom_point() +
geom_label(x=4, y=7, label = "Test label")
Run Code Online (Sandbox Code Playgroud)
我想将测试标签周围的圆角矩形弄成正方形。
谢谢。
是的,您可以将该label.r参数设置为 0。
library(ggplot2)
ggplot(iris, aes(Sepal.Width, Sepal.Length)) + geom_point() +
geom_label(x=4, y=7, label = "Test label",
label.r = unit(0, "pt"))
Run Code Online (Sandbox Code Playgroud)

由reprex 包于 2021 年 12 月 18 日创建(v2.0.1)
| 归档时间: |
|
| 查看次数: |
602 次 |
| 最近记录: |