kaplanmeier
kaplanmeier copied to clipboard
cannot plot data with km.plot
myeloma_kaplan_clean.csv Thanks for your work. I'm using Pycharm and I'm not able to plot for my data. Please see attached file. Is there a way to save the plot instead of showing it?
Fixed by adding plt.show()
I added a small example in the documentationpages to save plots. I also added the visible input parameter and dpi. Update to the latest version with:
pip install -U kaplanmeier
import kaplanmeier as km
import pandas as pd
df = pd.read_csv(r'myeloma_kaplan_clean.csv', sep=';')
results = km.fit(df['time'], df['died'], df['sex'])
fig, ax = km.plot(results, visible=True, savepath='fig.png')