I have got an sorted array of integers and I want to plot a Cumulative Distribution Function for it. However , the nature of data is uncertain , so I think I cannot use any predefined library for it.
So to implement it , I have used interpolation function (scipy.interpolate). I am doing it like this :
def plot_cdf(self,x,y,):
        tck = interpolate.splrep(x,y,s=0)
        y = interpolate.splev(x,tck,der=0)
        plt.figure()
        plt.plot(x,y)
        xlabel("Percentage")
        ylabel("Unavailability slot duration")
        plt.show()
Can it be improved??? Is there any predefined function for it????