Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

drawing bivariate gaussian distributions in matplotlib

How can we plot (in python matplotlib) bivariate Gaussian Distributions , given their centers and covariance matrices as numpy arrays?

Let's say that our parameters are as follows:

center1=np.array([3,3])
center2=np.array([5,5])
cov1=np.array([ [1.,.5], [.5,.1]])
cov2=np.array([ [.2,.5], [.5,.2]])
like image 548
red Avatar asked Mar 02 '12 22:03

red


People also ask

How do you plot a normal distribution in a Jupyter notebook?

pdf returns a PDF value, we can use this function to plot the normal distribution function. We graph a PDF of the normal distribution using scipy , numpy and matplotlib . We use the domain of −4<𝑥<4, the range of 0<𝑓(𝑥)<0.45, the default values 𝜇=0 and 𝜎=1. plot(x-values,y-values) produces the graph.


1 Answers

Here's an example from the the gallery: http://matplotlib.sourceforge.net/mpl_examples/pylab_examples/contour_demo.py

like image 100
ev-br Avatar answered Oct 06 '22 12:10

ev-br