so this is my code
res.cox_sam = survfit(Surv(time, event) ~ severity_fac, data = spec_variant_samples)
sp = ggsurvplot(res.cox_sam,
size = 1,
fun = "event",
conf.int = F,
xlim = c(40, 100), risk.table = "abs_pct", pval = TRUE, surv.median.line = "hv",
xlab = "Age in years",
ylab = "Cumulative event",
break.time.by = 10,
font.legend = c(15),
legend.title="",
font.tickslab = c(15),
font.x = c(15, "bold"),
font.y = c(15, "bold"))
if I change it into this below, which I do to make one specific line thicker, it doesn't work:
res.cox_sam = survfit(Surv(time, event) ~ severity_fac, data = spec_variant_samples)
sp = ggsurvplot(res.cox_sam,
size = c(1, 1, 3, 1, 1, 1, 1)
fun = "event",
conf.int = F,
xlim = c(40, 100), risk.table = "abs_pct", pval = TRUE, surv.median.line = "hv",
xlab = "Age in years",
ylab = "Cumulative event",
break.time.by = 10,
font.legend = c(15),
legend.title="",
font.tickslab = c(15),
font.x = c(15, "bold"),
font.y = c(15, "bold"))
But if I do for example this, then it give all the lines a different size:
res.cox_sam = survfit(Surv(time, event) ~ severity_fac, data = spec_variant_samples)
sp = ggsurvplot(res.cox_sam,
size = "strata"
fun = "event",
conf.int = F,
xlim = c(40, 100), risk.table = "abs_pct", pval = TRUE, surv.median.line = "hv",
xlab = "Age in years",
ylab = "Cumulative event",
break.time.by = 10,
font.legend = c(15),
legend.title="",
font.tickslab = c(15),
font.x = c(15, "bold"),
font.y = c(15, "bold"))
does anyone knows why it doesn't work to change a specific line while it should be possible based on the last line of code only this is not specific? and how could I make this work?
I already tried to do grab the plot argument from the ggsurvplot and then scale_size_manual but also without succes.
So I found out myself how to fix this.
By first doing the strata size argument you get the same number of levels in your ggsurvplot object. After that you can use ggplot by grabbing the plot object out of the ggsurvplot object and use the ggplot arguments. In this case the scale_size_manual.
This would not work if you in the beginning just have one size set in the ggsurvplot object (size = 3; for example).
Hope this will help someone else out as well.