Open DarioS opened 2 years ago
I'm not a maintainer, but I have somewhat of a solution.
plot <- ggsurvplot(fit, data = aml, title = "Reproducible Example", conf.int = FALSE)
plot[["plot"]] + theme(plot.title = element_text(hjust = 0.5))
It seems somewhere along the line, the title information is being set as plot.title
instead of title
.
As for your problem with conf.int
being set to false but still returning a plot with confidence intervals. I found the problem where when calling ggsurvplot
and you have no strata defined and did not explicitly set conf.int
to either true or false, it is automatically set to true. I think that is a poor design decision as it is not clear that explicitly setting the value to the default value gets rid of this behavior.
The solution proposed in #463 creates a left-centred title these days.
Created on 2022-05-04 by the reprex package (v2.0.1)
Also, note that the default value of
conf.int
isFALSE
, but confidence intervals are drawn regardless. The default was ignored.