

.. _sphx_glr_gallery_statistics:

.. _statistics_examples:

Statistics
==========



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Bar charts are useful for visualizing counts, or summary statistics with error bars. Also see t...">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_barchart_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_barchart_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Percentiles as horizontal bar chart</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how to use the various keyword arguments to fully customize box plots...">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_boxplot_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_boxplot.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Artist customization in box plots</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This plot illustrates how to create two types of box plots (rectangular and notched), and how t...">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_boxplot_color_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_boxplot_color.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Box plots with custom fill colors</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Visualizing boxplots with matplotlib.">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_boxplot_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_boxplot_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Boxplots</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Note that although violin plots are closely related to Tukey&#x27;s (1977) box plots, they add usefu...">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_boxplot_vs_violin_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_boxplot_vs_violin.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Box plot vs. violin plot comparison</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how to pass pre-computed box plot statistics to the box plot drawer. ...">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_bxp_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_bxp.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Boxplot drawer function</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to plot a confidence ellipse of a two-dimensional dataset, using its pea...">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_confidence_ellipse_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_confidence_ellipse.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Plot a confidence ellipse of a two-dimensional dataset</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how to fully customize violin plots. The first plot shows the default...">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_customized_violin_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_customized_violin.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Violin plot customization</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This exhibits the most basic use of the error bar method. In this case, constant values are pro...">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_errorbar_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_errorbar.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Errorbar function</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Errors can be specified as a constant value (as shown in /gallery/statistics/errorbar). However...">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_errorbar_features_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_errorbar_features.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Different ways of specifying error bars</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In matplotlib, errors bars can have &quot;limits&quot;. Applying limits to the error bars essentially mak...">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_errorbar_limits_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_errorbar_limits.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Including upper and lower limits in error bars</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In this example, we snazz up a pretty standard error bar plot by adding a rectangle patch defin...">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_errorbars_and_boxes_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_errorbars_and_boxes.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Creating boxes from error bars using PatchCollection</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="~.Axes.hexbin is a 2D histogram plot, in which the bins are hexagons and the color represents t...">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_hexbin_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_hexbin_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Hexagonal binned plot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="How to plot histograms with Matplotlib.">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_hist_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_hist.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Histograms</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to plot the empirical cumulative distribution function (ECDF) of a sampl...">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_histogram_cumulative_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_histogram_cumulative.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Plotting cumulative distributions</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In addition to the basic histogram, this demo shows a few optional features:">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_histogram_features_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_histogram_features.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Some features of the histogram (hist) function</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip=" Histogram with step curve that has a color fill.  Histogram with step curve with no fill.  His...">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_histogram_histtypes_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_histogram_histtypes.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Demo of the histogram function's different histtype settings</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot histogram with multiple sample sets and demonstrate:">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_histogram_multihist_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_histogram_multihist.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">The histogram (hist) function with multiple data sets</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example plots horizontal histograms of different samples along a categorical x-axis. Addit...">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_multiple_histograms_side_by_side_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_multiple_histograms_side_by_side.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Producing multiple histograms side by side</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how to efficiently visualize large numbers of time series in a way th...">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_time_series_histogram_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_time_series_histogram.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Time Series Histogram</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Violin plots are similar to histograms and box plots in that they show an abstract representati...">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_violinplot_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_violinplot.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Violin plot basics</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/statistics/barchart_demo
   /gallery/statistics/boxplot
   /gallery/statistics/boxplot_color
   /gallery/statistics/boxplot_demo
   /gallery/statistics/boxplot_vs_violin
   /gallery/statistics/bxp
   /gallery/statistics/confidence_ellipse
   /gallery/statistics/customized_violin
   /gallery/statistics/errorbar
   /gallery/statistics/errorbar_features
   /gallery/statistics/errorbar_limits
   /gallery/statistics/errorbars_and_boxes
   /gallery/statistics/hexbin_demo
   /gallery/statistics/hist
   /gallery/statistics/histogram_cumulative
   /gallery/statistics/histogram_features
   /gallery/statistics/histogram_histtypes
   /gallery/statistics/histogram_multihist
   /gallery/statistics/multiple_histograms_side_by_side
   /gallery/statistics/time_series_histogram
   /gallery/statistics/violinplot

