Python ile Gaussian PDF


import math

import numpy as np

import matplotlib.mlab as mlab

import matplotlib.pyplot as plt



mu_1 = 150

mu_2 = 180

var_1 = 90

var_2 = 90


sigma_1 = math.sqrt(var_1)

sigma_2 = math.sqrt(var_1)


x_1 = np.linspace(mu_1 - 3*sigma_1, mu_1 + 3*sigma_1, 100)

y_1 = mlab.normpdf(x_1, mu_1, sigma_1)


x_2 = np.linspace(mu_2 - 3*sigma_2, mu_2 + 3*sigma_2, 100)

y_2 = mlab.normpdf(x_2, mu_2, sigma_2)


plt.plot(x_1,y_1,'r')

plt.plot(x_2,y_2,'b')

plt.show()