在 ggplot 标题中增加下划线大小

4
我正在尝试增加ggplot标题下划线的大小/宽度/厚度。我已经尝试使用size、width和length,但没有成功。
以下是我所做的示例。
test <- tibble(x = 1:5, 
y = 1, 
z = x ^ 2 + y)

ggplot(test, aes(x,z)) +
geom_point() +
labs(title = expression(paste(underline("Increasing"), " underline")))+
theme(plot.title = element_text(size = 20))

这里输入图片描述欢迎提供任何想法。

1个回答

5

很好的问题。我第一次理解得对吗?

将下划线与另一个下划线重叠。

library(ggplot2)
library(tibble)

test <- tibble(x = 1:5, 
               y = 1, 
               z = x ^ 2 + y)

ggplot(test, aes(x, z)) +
  geom_point() +
  labs(title = expression(paste(underline(underline("Increasing")), " underline"))) +
  theme(plot.title = element_text(size = 20))

enter image description here


听起来是个好主意,但当我尝试使用示例和预期的情节时,它却在空格和行上出现了问题。 - Edgar Zamora

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接