import numpy as np
import matplotlib.pyplot as plt
import pylab as pl
import random

def gaussian(x,mu,sig):
    return np.exp(-np.power(x-mu,2.)/(2*np.power(sig,2.)))

for mu,sig in [(-1,1),(0,2),(2,3)]:
    plt.plot(gaussian(np.linspace(-3,3,120),mu,sig))

plt.show()

###

histogram = plt.figure()
x = [random.gauss(5,3) for i in range(400)]
y = [random.gauss(6,2) for i in range(400)]

bins = np.linspace(-5,10,100)

plt.hist(x, bins)
plt.hist(y,bins)

plt.savefig("histogramgaussi.png")
plt.show()
