Do not attempt to draw legend on survival curves if only one curve
This commit is contained in:
parent
8238383edb
commit
ae1a4cb5b8
@ -80,7 +80,9 @@ def kaplanmeier(df, time, status, by=None, *, ci=True, transform_x=None, transfo
|
||||
ax.set_ylabel('Survival probability ({:.0%} CI)'.format(1-config.alpha) if ci else 'Survival probability')
|
||||
ax.set_xlim(left=0)
|
||||
ax.set_ylim(0, 1)
|
||||
ax.legend()
|
||||
|
||||
if by is not None:
|
||||
ax.legend()
|
||||
|
||||
return fig, ax
|
||||
|
||||
@ -174,7 +176,9 @@ def turnbull(df, time_left, time_right, by=None, *, step_loc=0.5, transform_x=No
|
||||
ax.set_ylabel('Survival probability')
|
||||
ax.set_xlim(left=0)
|
||||
ax.set_ylim(0, 1)
|
||||
ax.legend()
|
||||
|
||||
if by is not None:
|
||||
ax.legend()
|
||||
|
||||
return fig, ax
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user