2

I use the following code to facet plots in a survival analysis:

surv_plot <- ggsurvplot_facet(fit, matrix_surv, facet.by = c("Place","Year"),
             panel.labs =list(Lieu_libelle = c("Austria","Belgium","Denmark","Finland","Italy"), 
             Year = c("2018", "2019", "2020", "2021")))

I want to modify facet label text. With panel.labs, the names are indeed modified according the provided lists. But the labels still show the facetting argument so for each label, I first have either "Place: " or "Year: " before the name in the plot. How can I drop this? It would be like dropping "sex: " on the facets in the plots on these graphs.

Mata
  • 538
  • 3
  • 17

1 Answers1

0

You can use the internal function option short.panel.labs.

This will change your code to:

surv_plot <- ggsurvplot_facet(fit, matrix_surv, facet.by = c("Place","Year"),
             panel.labs =list(Lieu_libelle = c("Austria","Belgium","Denmark","Finland","Italy"), 
             Year = c("2018", "2019", "2020", "2021")),
             short.panel.labs=T)