Hi! Is there a way to edit the linetyep AND color of the lines in ggsuvplot
?
I have the following code so far:
g = ggsurvplot(fit,
xlab="Days",
size = 0.8,
legend = c(0.9, 0.7),
# linetype = c(1,2),
linetype = "strata",
palette = c("#fa5cf2", "#fa5cf2", "#ffa600", "#84d94e","#f25c78","#f25c78", "#b64cdf","#b64cdf"),
legend.title = element_blank(),
legend.labs = c("A","B",
"C", "D",
"E","F",
"G", "H"),
xlim = c(0,11),
font.legend = c(13, "plain", "black"),
font.x = c(15, 'plain', 'black'),
font.y = c(15, 'plain', 'black'),
font.tickslab = c(11, 'plain', 'black'),
surv.scale = 'percent'
)
g$plot
I get the following graph:
Basically, there are two legends there: 1 for the linestyle and 2 for the color.
I want to modify the linestyle for A
so that is has the dashed line, while the rest (B
to H
) are purely solid line. On top of that, I want to retain the color of the line as indicated by the array of colors in the palette
.
How to go about this? Thank you!