'ggsurvplot - Breaking legend in to rows

How do I break the legend into multiple rows? Currently, legend the legend plots as one row, but I would like to output it rows, there are 5 strata on one plot.

Thanks

survival <- survfit(Surv(Statustime, Status)~Strata, data=df1)
ggsurvplot(survival, legend = "bottom",conf.int = TRUE, pval = TRUE, risk.table = FALSE, xlim = c(0,180), break.time.by = 30)
ggsave("survival_ART.png", width = 5, height = 5)
r


Solution 1:[1]

I managed to find the answer myself - submitting here in case someone else finds this question and wonder what the answer was.

ggsurvplot(survival, legend = "bottom", conf.int = TRUE, pval = TRUE, risk.table = FALSE) + 
  guides(colour = guide_legend(nrow = 5))

where nrow = number of strata.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 wibeasley