Is it possible to change the colour of the censor tag in lifelines? The code-chunk that I used was
kmf.plot_survival_function(
show_censors=True,
censor_styles={'ms': 5, 'marker': '|'},
at_risk_counts=True,
ci_show=False
)
And how to truncate when the number at risk falls below a certain limit?
The underlying class that is used in
lifelinesfor drawing the markers ismatplotlib.lines.Line2D, andcensor_stylesis passed to that class askwargswhen you callplot_survival_function.You can use the property
markeredgecolor(ormec) with a color code and it'll change the marker color.Here's an example based on the KMF sample code from
lifelines's documentation.And the resulting image with my red markers: