0

所以我用生存曲线做了一个ggplot。

Wolcurves <- survfit(Surv(Days, Survival) ~ Wol, data = DCV_noPBS)
IFB_plot <- ggsurvplot(Wolcurves, data = DCV_noPBS, line = c(2, 1),pval = "p-value = 0",xlab = "Time in days", ylab = "Proportional survival", break.time.by = 1, break.y.by = 0.2, legend.labs = c("w1118wMel-Tet", "w1118wMel") 

)

我使用以下代码遇到了这个错误。

ggsave(filename = "results/IFB2.pdf", plot = IFB_plot, width = 12, height = 10, dpi = 1000, units = "cm")

UseMethod(“grid.draw”)中的错误:没有适用于“grid.draw”的方法应用于“c('ggsurvplot','ggsurv','list')”类的对象

如果我不指定 plot 参数并且只保存默认的最新图,它工作正常。

4

0 回答 0