kaplanmeier icon indicating copy to clipboard operation
kaplanmeier copied to clipboard

cannot plot data with km.plot

Open giansalvo opened this issue 2 years ago • 1 comments

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()

giansalvo avatar Jun 09 '23 10:06 giansalvo

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')

erdogant avatar Jun 23 '24 18:06 erdogant