Commit 57dd9e33 authored by Ben Glocker's avatar Ben Glocker

replaced deprecated matplotlib.mlab.normpdf with scipy.stats.norm.pdf

parent 8ae86f24
......@@ -362,14 +362,14 @@
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.mlab as mlab\n",
"from scipy.stats import norm\n",
"\n",
"def plot_gmm(x, gmm):\n",
" omega = gmm.weights_\n",
" mu = gmm.means_\n",
" sigma = np.sqrt(gmm.covariances_)\n",
" for ind in range(0,omega.shape[0]): \n",
" plt.plot(x,omega[ind]*mlab.normpdf(x, mu[ind], sigma[ind]), linewidth=2, label='GMM Component '+str(ind))\n",
" plt.plot(x,omega[ind]*norm.pdf(x, mu[ind], sigma[ind]), linewidth=2, label='GMM Component '+str(ind))\n",
"\n",
"plt.figure(figsize=(10, 4), dpi=100)\n",
"plt.hist(X, bins=num_bins, density=True, range=(lim_low, lim_high), label='Intensity histogram', color='lightgray');\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment