Hi,
There is a slight misplacement of the pvalue annotation when the caption is a bit long:
library(ggsurvfit)
sf <- survfit2(Surv(time, status) ~ sex, data = df_lung)
sf %>%
ggsurvfit() +
add_pvalue(location="annotation", caption="Adjusted 2-sided Log-rank")
Workaround:
(even better with hjust=1.05, vjust=2)
pval = survfit2_p(sf)
sf %>%
ggsurvfit() +
annotate("text", x = Inf, y = Inf, hjust=1, vjust=1,
label = glue::glue("Log-rank adjusted 2-sided {pval}"))

Hi,
There is a slight misplacement of the pvalue annotation when the caption is a bit long:
Workaround:
(even better with
hjust=1.05, vjust=2)