One option is using `ggsurvfit` package to draw KM plot, another is building self-defined function with `ggplot2`