0

Hi,

I am interested in trying to make a cumulative distribution function in Python. I have a set of data in a numpy array and just want to plot that data.

numpyArray = [0.4, 0.3, 0.6,1.2,1.8, 0.5]

I would also like to have a vertical line on the x-axis at 0.4 and 0.8. What would be the easiet way to do this?

Thanks.

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by Niner710
0

I used Matplotlib and tried to create this function. I just enter in the mean and std deviation into this function. When I get the cdf plot from this function it doesn't give me the right graph. Somehow something I am doing is wrong. Can anyone tell me what I'm doing wrong? Thanks.

  def norm_cdf(mean, std):
    # 50 numbers between -3s and 3s
    x = sp.linspace(0,0.5,10)
    # CDF at these values
    y = stats.norm.cdf(x, loc=mean, scale=std)

    plt.plot(x,y, color="black")
    plt.xlabel("Current(nA)")
    plt.ylabel("Cumulative Probability")
    plt.title("Bit Trace {0} & std. deviation = {1}".format(mean, std))
    plt.draw()
    plt.show()
    return
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.