python - trouble with normal distribution -
i have code plot gaussian distribution not centered on 0 should be:
def gaussn(x): return 1/(np.sqrt(2*np.pi))*np.exp(-0.5*x**2) x=np.linspace(-5,5) gaus=gaussn(x) plt.plot(gaus) why centered on 25 , not 0?
try plt.plot(x,gaus) instead. not specifying x-axis, it's running 0 50 (i.e., length of array).
Comments
Post a Comment