Draw 2-d distribution graphsΒΆ

In this example we are going to draw PDF and CDF of a bidimensional distribution.

from __future__ import print_function
import openturns as ot
import openturns.viewer as viewer
from matplotlib import pylab as plt
ot.Log.Show(ot.Log.NONE)

# assume a 2-d distribution
distribution = ot.Normal([0.0, 2.0], [1.0, 0.6], ot.CorrelationMatrix(2))
print(distribution)

Out:

Normal(mu = [0,2], sigma = [1,0.6], R = [[ 1 0 ]
 [ 0 1 ]])

draw PDF

graph = distribution.drawPDF()
view = viewer.View(graph)
[X0,X1] iso-PDF

draw CDF

graph = distribution.drawCDF()
view = viewer.View(graph)
plt.show()
[X0,X1] iso-CDF

Total running time of the script: ( 0 minutes 0.253 seconds)

Gallery generated by Sphinx-Gallery