How do I change the line type for the sex strata so that it is a line without all the small "crosses" as shows in the picture below? I hope to get just a solid line instead. The cross makes things look a little congested when there is a lot of data points.
library(survminer)
fit <- survfit( Surv(time, status) ~ sex, data = colon )
ggsurvplot(fit, colon,
palette = "jco", pval = TRUE)
You just have to set censor=FALSE
.
library(survminer)
library(survival) # to obtain the colon dataset
fit <- survfit(Surv(time, status) ~ sex, data = colon)
ggsurvplot(fit, colon, censor = FALSE,
palette = "jco", pval = TRUE)
If you search the help of ggsurvplot
, you will find there are more parameters to customize the censored events:
censor: logical value. If TRUE (default), censors will be drawn.
censor.shape: character or numeric value specifying the point shape of censors. Default value is "+" (3), a sensible choice is "|" (124).
censor.size: numeric value specifying the point size of censors. Default is 4.5.