我刚把我的R更新到4.2版。直到现在,如果文本是粗体的话,Ggtext可以很好地擦除单词之间的空格。我找到了一个RStudio论坛上类似的问题,但不是我的解决方案。
一个可复制的示例如下所示(虽然在其他R版本中可能无法复制,因为直到今天上午,它对我来说确实很好)。
library(ggplot2)
library(ggtext)
p <- ggplot() +
geom_blank() +
labs(title = "A title with some words") +
theme(plot.title = element_textbox_simple(
face = "bold"))
p

没有bold
library(ggplot2)
library(ggtext)
p <- ggplot() +
geom_blank() +
labs(title = "A title with some words") +
theme(plot.title = element_textbox_simple())
p

发布于 2022-05-08 14:41:47
您只需使用**bold text**使文本粗体:
library(ggplot2)
library(ggtext)
p <- ggplot() +
geom_blank() +
labs(title = "**A title with some words**") +
theme(plot.title = element_textbox_simple())
p输出:

https://stackoverflow.com/questions/72161118
复制相似问题