GGSURVLOT使用正确的尺寸保存输出

GGSURVLOT使用正确的尺寸保存输出,r,R,如何以高度为2.2英寸、宽度为3.3英寸、分辨率为1000的jpeg格式保存输出 这是我当前的代码 tar <- survfit(Surv(Y1$survialNew,Y1$p_censor) ~ 1 + Y1$Previous_Sternotomy + Y1$PGD_Grade1) ggsurvplot(tar, data = Y1, xlab="Months Post Transplant", ylab="Overall Survival", pval = TRUE) 有人能

如何以高度为2.2英寸、宽度为3.3英寸、分辨率为1000的jpeg格式保存输出

这是我当前的代码

tar <- survfit(Surv(Y1$survialNew,Y1$p_censor) ~ 1 + 
Y1$Previous_Sternotomy + Y1$PGD_Grade1)
ggsurvplot(tar, data = Y1, xlab="Months Post Transplant", 
  ylab="Overall Survival", pval = TRUE)
有人能给我推荐下几行代码吗?或者我们可以把所有的东西都放在地下停车场

谢谢, Tariq

将ggsurvplot的输出存储到变量,然后将其传递给ggsave:

将GGSURVLOT的输出存储到变量,然后将其传递给ggsave:


我遇到了使用GGSURVLOT创建高分辨率绘图的相同问题。我不确定Artem的代码是否有效,因为我试过了。我想应该改变一下

ggsave("myplot.jpg", plot = print(gg), width = 3.3, height = 2.2, dpi = 1000)

添加plot=print很重要,我遇到了使用ggsurvplot创建高分辨率绘图的相同问题。我不确定Artem的代码是否有效,因为我试过了。我想应该改变一下

ggsave("myplot.jpg", plot = print(gg), width = 3.3, height = 2.2, dpi = 1000)
添加plot=print很重要