how can I add a text on ggsurvplot graph?


I'm now having a difficulty with ggsurvplot() function.

All I want is just adding a two-line text on the graph.

However, since those 'gg-'things would not accept '+' symbol,

annotation() never works.

Of course, grob(), text() also did not work.

Now since this drives me over the wall, I need your help.


Hi @timjun90 ,

something like this

fit <- survfit(Surv(time, status) ~ sex, data = lung)
timjun90 <- ggsurvplot(fit, data = lung) 
timjun90$plot + geom_text(x = 500, y = 1, label="timjun90")

ggsurvplot is not a classical gg object but its subcomponent "plot" is. Hope it gives you some ideas.