I want to plot a Gaussian Mixture Model. The following code allows me to plot 2 separate Gaussians, but where they intersect, the line is very sharp and not smooth enough. Is there a way to plot the pdf of a 1D GMM?
def plot_data():
mu = [-6, 5]
var = [2, 3]
sigma = [np.sqrt(var[0]), np.sqrt(var[1])]
x = np.linspace(-10, 10, 100)
curve_0 = mlab.normpdf(x, mu[0], sigma[0])
curve_1 = mlab.normpdf(x, mu[1], sigma[1])
import ipdb; ipdb.set_trace()
plt.plot(x, curve_0, color='grey')
plt.plot(x, curve_1, color='grey')
plt.fill_between(x,curve_0 , color='grey')
plt.fill_between(x,curve_1, color='grey')
plt.show()
plt.savefig('data_t0.jpg')