I am trying to customize the ax from matplotlib plot. Here I am using a surpyval package to fit the data and then plot it. The plot method in surpyval package does not accept arguments other than the ax=ax as I provided. My problem is i can't match the handles and legends as you can see from this example:
import surpyval as surv
import matplotlib.pyplot as plt
y_a = np. array([181, 183, 190,190, 195, 195, 198, 198, 198, 201,202, 202, 202,
204, 205, 205, 206,206, 206, 206,207, 209 , 213, 214, 218, 219])
y_s = np.array([161, 179, 196,196, 197, 198, 204, 205, 209, 211,215, 218, 227,
230, 231, 232, 232 ,236, 237, 237,240, 243, 244, 246, 252, 255])
model_1 = surv.Weibull.fit(y_a)
model_2 = surv.Weibull.fit(y_s)
ax=plt.gca()
model_1.plot(ax=ax)
model_2.plot(ax=ax)
p_a = ['A', 'a_u_CI','a_l_CI', 'a_fit']
p_s= ['S', 's_u_CI','s_l_CI', 's_fit']
p_t = p_a + p_s
ax.legend(labels=p_t[0:5:4])