如何删除geom_label_repel周围的行。使用label.size = 0似乎没有明显的效果。我可以设置“颜色”
library(ggplot2)
library(ggrepel)
ggplot(mtcars, aes(wt, mpg, color = wt)) +
geom_point(color = 'red') +
geom_label_repel(aes(label = rownames(mtcars)), label.size = 0, fill = "white") +
theme_classic(base_size = 16)偶尔可以在空白geom_text_repel后输入geom_label_repel,但这并不可靠:框可能会出现在与文本不同的位置。

发布于 2017-06-25 11:07:35
正如eipi10在注释中指出的那样,设置label.size=NA
library(ggplot2)
library(ggrepel)
ggplot(mtcars, aes(wt, mpg, color = wt)) +
geom_point(color = 'red') +
geom_label_repel(aes(label = rownames(mtcars)), label.size = NA, fill = "white") +
theme_classic(base_size = 16)发布于 2018-05-09 03:35:28
您可以使用geom_text_repel geom省略标签框。
library(ggplot2)
library(ggrepel)
g <- ggplot(mtcars, aes(wt, mpg, color = wt)) +
geom_point(color = 'red') +
theme_classic(base_size = 16)
g + geom_label_repel(aes(label = rownames(mtcars)), fill = "white")

g + geom_text_repel(aes(label = rownames(mtcars)))

此外,根据帮助页面:
当前为
geom_label_repel...比geom_text_repel慢得多。
https://stackoverflow.com/questions/44275000
复制相似问题