gpt4 book ai didi

r - 增加 ggplot 标题中的下划线大小

转载 作者:行者123 更新时间:2023-12-04 11:30:16 26 4
gpt4 key购买 nike

我正在尝试增加 ggplot 标题中下划线的大小/宽度/厚度。我曾尝试使用大小、宽度和长度,但没有成功。

这是我所做的一个例子。

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))

enter image description here任何想法,将不胜感激。

最佳答案

好问题。我一开始就做对了吗?

用另一个下划线覆盖下划线。

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

关于r - 增加 ggplot 标题中的下划线大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57344066/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com