You just need to specify a vector of flowers of the same length as the number of lines (i.e. groups) in your plot. You can do it like
N <- length(unique(group))
plot(kmsurvival1, xlab="Time",ylab="Survival Probability", mark.time = F,
col=1:N)
legend(
"topright",
legend=unique(group),
col=1:N,
horiz=FALSE,
bty='n')
or you can manually specify the colors col=c('black','blue','red')(depending on how many colors you need).
From example in ?plot.survfit,
library(survival)
leukemia.surv <- survfit(Surv(time, status) ~ x, data = aml)
plot(leukemia.surv, lty = 2:3,col=3:4)
lLab <- gsub("x=","",names(leukemia.surv$strata))
legend(
"top",
legend=lLab,
col=3:4,
lty=2:3,
horiz=FALSE,
bty='n')

source
share