是否可以调整地层指示器的厚度?
图例中的指标没有风险表中的那么粗。
library(survminer)
library(survival)
fit <- survfit(Surv(time, status) ~ sex, data = lung)
p <- ggsurvplot(
fit,
size = 1,
legend.labs = c("A", "B"),
linetype = "solid",
break.time.by = 365,
palette = c("#E7B800", "#2E9FDF"),
risk.table = TRUE,
censor = FALSE,
risk.table.title = "No. at risk",
tables.y.text = FALSE,
legend.title = "",
tables.theme = theme_cleantable() +
theme(plot.title = element_text(size = 20))
)
p
红色箭头表示线条粗细的差异。
我尝试调整,但我不知道如何找出哪个参数与指标相关。如果有的话。
tables.theme = theme_cleantable() +
theme(plot.title = element_text(size = 20),
strata.line.x = element_line(size = 5.5))
风险表中 y 轴 (
tables.y.text
) 上显示的文本默认为 TRUE。如果将其更改为 FALSE,您将得到一条粗线。这是使用 ggtext 包中的 element_markdown
在内部实现的。实际功能是.set_large_dash_as_ytext
.
我同意它比应有的厚。但是,您可以将其更改为使用 thinner 破折号以及小 em 破折号的 unicode 值 (\ufe58):
p$table <- p$table +
scale_y_discrete(labels=rep("\ufe58", 2)) +
theme(plot.margin = margin(0, 0, 0, 0, "cm")); p