Allow passing own fig, ax to yli.kaplanmeier
This commit is contained in:
parent
26a6766f0e
commit
675422246f
@ -22,7 +22,7 @@ from .config import config
|
||||
from .sig_tests import ChiSquaredResult
|
||||
from .utils import Estimate, check_nan
|
||||
|
||||
def kaplanmeier(df, time, status, by=None, *, ci=True, transform_x=None, transform_y=None, nan_policy='warn'):
|
||||
def kaplanmeier(df, time, status, by=None, *, ci=True, transform_x=None, transform_y=None, nan_policy='warn', fig=None, ax=None):
|
||||
"""
|
||||
Generate a Kaplan–Meier plot
|
||||
|
||||
@ -59,6 +59,7 @@ def kaplanmeier(df, time, status, by=None, *, ci=True, transform_x=None, transfo
|
||||
# Covert timedelta to numeric
|
||||
df, time_units = survtime_to_numeric(df, time)
|
||||
|
||||
if ax is None:
|
||||
fig, ax = plt.subplots()
|
||||
|
||||
if by is not None:
|
||||
|
Loading…
Reference in New Issue
Block a user