Closed shraddhapai closed 6 years ago
Use this:
ggsurvlist <- list(
x = ggsurvplot(fit1, data=lung),
y = ggsurvplot(fit2,data=lung)
)
# Arrange multiple ggsurvplots and print the output
arrange_ggsurvplots(ggsurvlist, print = TRUE, ncol = 2, nrow = 1)
# Arrange and save into pdf file
res <- arrange_ggsurvplots(ggsurvlist, print = FALSE)
ggsave("myfile.pdf", res)
Perfect, thank you. That resolves my issue. Didn't realize there was a built-in function because I use a third-party script to achieve this in ggplot2. Regards,Shraddha
great! so we can close this issue
Hi,
I have multiple ggsurvplot objects that I would like to tile. For ggplot2 I normally use multiplot (from here: http://www.cookbook-r.com/Graphs/Multiple_graphs_on_one_page_(ggplot2)/) to lay out the graphs in a matrix format. However, running multiplot() on ggsurvplot objects does not tile these; rather it uses a new window for each image. Could you please suggest a way to achieve the tiling? I have 12 conditions for 4 tumours that I need to display in this format and copy-pasting graphs into a photo editor would be tedious.
Thanks! Shraddha Shraddha Pai Post-doctoral Research Fellow, http://baderlab.org University of Toronto
Steps to reproduce the problem
session_info()