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]])
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.
Here's an example from the the gallery: http://matplotlib.sourceforge.net/mpl_examples/pylab_examples/contour_demo.py
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With