def plot(self):
        x = []
        #iterate through the groups
        for i in range(len(self.points)):
            #plot x and y
            plt.plot(np.array(self.points[i][0]),np.array(self.points[i][1]))
            #create lists of all the x and y values
            x += self.points[i][0]
        for j in range(len(self.censoredPoints)):
            #check if censoring is occuring
            if (self.censoredPoints[j][1] != 0):
                #if this is the first censored point
                if (self.censoredPoints[j][3] == 1) and (j == 0):
                    #calculate a distance beyond 1 to place it
                    #so all the points will fit
                    dx = ((1./((self.censoredPoints[j][1])+1.))
                    *(float(self.censoredPoints[j][0])))
                    #iterate through all the censored points at this time
                    for k in range(self.censoredPoints[j][1]):
                        #plot a vertical line for censoring
                        plt.vlines((1+((k+1)*dx)),
                                   self.censoredPoints[j][2]-0.03,
                                   self.censoredPoints[j][2]+0.03)
                #if this censored point starts a new group
                elif ((self.censoredPoints[j][3] == 1) and
                      (self.censoredPoints[j-1][3] == 1)):
                    #calculate a distance beyond 1 to place it
                    #so all the points will fit
                    dx = ((1./((self.censoredPoints[j][1])+1.))
                    *(float(self.censoredPoints[j][0])))
                    #iterate through all the censored points at this time
                    for k in range(self.censoredPoints[j][1]):
                        #plot a vertical line for censoring
                        plt.vlines((1+((k+1)*dx)),
                                   self.censoredPoints[j][2]-0.03,
                                   self.censoredPoints[j][2]+0.03)
                #if this is the last censored point
                elif j == (len(self.censoredPoints) - 1):
                    #calculate a distance beyond the previous time
                    #so that all the points will fit
                    dx = ((1./((self.censoredPoints[j][1])+1.))
                    *(float(self.censoredPoints[j][0])))
                    #iterate through all the points at this time
                    for k in range(self.censoredPoints[j][1]):
                        #plot a vertical line for censoring
                        plt.vlines((self.censoredPoints[j-1][0]+((k+1)*dx)),
                                   self.censoredPoints[j][2]-0.03,
                                   self.censoredPoints[j][2]+0.03)
                #if this is a point in the middle of the group
                else:
                    #calcuate a distance beyond the current time
                    #to place the point, so they all fit
                    dx = ((1./((self.censoredPoints[j][1])+1.))
                    *(float(self.censoredPoints[j+1][0])
                      - self.censoredPoints[j][0]))
                    #iterate through all the points at this time
                    for k in range(self.censoredPoints[j][1]):
                        #plot a vetical line for censoring
                        plt.vlines((self.censoredPoints[j][0]+((k+1)*dx)),
                                   self.censoredPoints[j][2]-0.03,
                                   self.censoredPoints[j][2]+0.03)
        #set the size of the plot so it extends to the max x and above 1 for y
        plt.xlim((0,np.max(x)))
        plt.ylim((0,1.05))
        #label the axes
        plt.xlabel('time')
        plt.ylabel('survival')
        plt.show()
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/sandbox/km_class.py/KAPLAN_MEIER.plot/original