diff --git a/lifelines/plotting.py b/lifelines/plotting.py index fb0ae1e3c..fc12b408b 100644 --- a/lifelines/plotting.py +++ b/lifelines/plotting.py @@ -224,11 +224,11 @@ def set_kwargs_color(kwargs): if int(major_version) == 1 and int(minor_version) < 5: raise ValueError('Matplotlib versions less than 1.5 no longer supported.') elif int(major_version) == 2: - kwargs['color'] = coalesce(kwargs.get('c'), kwargs.get('color'), - kwargs["ax"]._get_lines.get_next_color()) + kwargs['c'] = coalesce(kwargs.get('c'), kwargs.get('color'), + kwargs["ax"]._get_lines.get_next_color()) else: - kwargs['color'] = coalesce(kwargs.get('c'), kwargs.get('color'), - next(kwargs["ax"]._get_lines.prop_cycler)['color']) + kwargs['c'] = coalesce(kwargs.get('c'), kwargs.get('color'), + next(kwargs["ax"]._get_lines.prop_cycler)['color']) def set_kwargs_drawstyle(kwargs): @@ -267,7 +267,7 @@ def _plot_loglogs(loc=None, iloc=None, show_censors=False, censor_styles=None, * # plot censors ax = kwargs['ax'] - colour = kwargs['color'] + colour = kwargs['c'] if show_censors and cls.event_table['censored'].sum() > 0: cs = { @@ -353,7 +353,7 @@ def plot(loc=None, iloc=None, show_censors=False, # plot censors ax = kwargs['ax'] - colour = kwargs['color'] + colour = kwargs['c'] if show_censors and cls.event_table['censored'].sum() > 0: cs = { diff --git a/tests/utils/test_utils.py b/tests/utils/test_utils.py index 94e55edaf..3c7f7b86a 100644 --- a/tests/utils/test_utils.py +++ b/tests/utils/test_utils.py @@ -329,6 +329,14 @@ def test_both_concordance_index_function_deal_with_ties_the_same_way(): assert fast_cindex(actual_times, predicted_times, obs) == slow_cindex(actual_times, predicted_times, obs) == 1.0 +def test_concordance_index_function_exits(): + N = 10 * 1000 + actual_times = np.random.exponential(1, size=N) + predicted_times = np.random.exponential(1, size=N) + obs = np.ones(N) + assert fast_cindex(actual_times, predicted_times, obs) + + def test_survival_table_from_events_with_non_negative_T_and_no_lagged_births(): n = 10 T = np.arange(n)