.. only:: html
.. note::
:class: sphx-glr-download-link-note
Click :ref:`here ` to download the full example code
.. rst-class:: sphx-glr-example-title
.. _sphx_glr_auto_probabilistic_modeling_distributions_plot_draw_1d_distribution.py:
Draw 1-d distribution graphs
============================
In this example we are going to draw PDF and CDF of an unidimensional distribution.
.. code-block:: default
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 an 1-d distribution
distribution = ot.Gumbel(0.45, 0.6)
print(distribution)
.. rst-class:: sphx-glr-script-out
Out:
.. code-block:: none
Gumbel(beta = 0.45, gamma = 0.6)
draw PDF
.. code-block:: default
graph = distribution.drawPDF()
# IMPORTANT: note that this command just generates the graph data
# and is only drawn in the context of Jupyter notebooks.
# To plot from a script, see the viewer module.
view = viewer.View(graph)
.. image:: /auto_probabilistic_modeling/distributions/images/sphx_glr_plot_draw_1d_distribution_001.png
:alt: plot draw 1d distribution
:class: sphx-glr-single-img
draw CDF
.. code-block:: default
graph = distribution.drawCDF()
view = viewer.View(graph)
plt.show()
.. image:: /auto_probabilistic_modeling/distributions/images/sphx_glr_plot_draw_1d_distribution_002.png
:alt: plot draw 1d distribution
:class: sphx-glr-single-img
.. rst-class:: sphx-glr-timing
**Total running time of the script:** ( 0 minutes 0.157 seconds)
.. _sphx_glr_download_auto_probabilistic_modeling_distributions_plot_draw_1d_distribution.py:
.. only :: html
.. container:: sphx-glr-footer
:class: sphx-glr-footer-example
.. container:: sphx-glr-download sphx-glr-download-python
:download:`Download Python source code: plot_draw_1d_distribution.py `
.. container:: sphx-glr-download sphx-glr-download-jupyter
:download:`Download Jupyter notebook: plot_draw_1d_distribution.ipynb `
.. only:: html
.. rst-class:: sphx-glr-signature
`Gallery generated by Sphinx-Gallery `_