1

I'm trying to combine multiple survival plots, using arrange_ggsurvplots. Each plots was made by ggsurvplot function. Most of them works well. However, it is difficult to combine legends.

let's take an example in survminer packages.

https://rpkgs.datanovia.com/survminer/reference/arrange_ggsurvplots.html

# Fit survival curves
require("survival")
fit<- survfit(Surv(time, status) ~ sex, data = lung)

# List of ggsurvplots
require("survminer")
splots <- list()
splots[[1]] <- ggsurvplot(fit, data = lung, risk.table = TRUE, ggtheme = theme_minimal())
splots[[2]] <- ggsurvplot(fit, data = lung, risk.table = TRUE, ggtheme = theme_grey())

# Arrange multiple ggsurvplots and print the output
arrange_ggsurvplots(splots, print = TRUE,
  ncol = 2, nrow = 1, risk.table.height = 0.4)

enter image description here

As you can see, the legend was not combined. Each column has it own legend.

I want to combine it. However, common methods with cowplot packages like ggarrange function didn't worked. Is there a better solution for this?

ESKim
  • 422
  • 4
  • 14
  • If you want to change the data that each graph contains, but not the style of the graphs, it may be better to look into using `ggsurvplot_facet`. This may require stacking multiple datasets so you can run a single `survfit` command. – JWilliman Aug 12 '19 at 22:19
  • do you want to remove y axis information in the 2nd plot? – user63230 Nov 11 '21 at 17:14

0 Answers0