How to make beautiful Kaplan-Meier plots Kaplan-Meier plots are ubiquitous in survival analyses, but it is difficult to find software that will produce publication quality plots. Here we will discuss Kaplan-Meier plots and provide code for plotting them with pylab. The code is available here and a video that goes over the code can be viewed here or below. The data used in the video is also available for download (your data will be expected to be in this format). I am aware that the code can be written much more compactly, but is displayed exactly as originally written, which I view easiest to understand and follow. When using your own data you will likely have to change the ax.set_xticks to suit your data. If you want to plot the censored data as something other than vertical lines, you can replace the vline function with the scatter function, and choose from these available markers.