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

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -