
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "plot_types/stats/hist_plot.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        Click :ref:`here <sphx_glr_download_plot_types_stats_hist_plot.py>`
        to download the full example code

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_plot_types_stats_hist_plot.py:


=======
hist(x)
=======

See `~matplotlib.axes.Axes.hist`.

.. GENERATED FROM PYTHON SOURCE LINES 8-26



.. image-sg:: /plot_types/stats/images/sphx_glr_hist_plot_001.png
   :alt: hist plot
   :srcset: /plot_types/stats/images/sphx_glr_hist_plot_001.png, /plot_types/stats/images/sphx_glr_hist_plot_001_2_0x.png 2.0x
   :class: sphx-glr-single-img





.. code-block:: default

    import matplotlib.pyplot as plt
    import numpy as np

    plt.style.use('_mpl-gallery')

    # make data
    np.random.seed(1)
    x = 4 + np.random.normal(0, 1.5, 200)

    # plot:
    fig, ax = plt.subplots()

    ax.hist(x, bins=8, linewidth=0.5, edgecolor="white")

    ax.set(xlim=(0, 8), xticks=np.arange(1, 8),
           ylim=(0, 56), yticks=np.linspace(0, 56, 9))

    plt.show()


.. _sphx_glr_download_plot_types_stats_hist_plot.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: hist_plot.py <hist_plot.py>`



  .. container:: sphx-glr-download sphx-glr-download-jupyter

     :download:`Download Jupyter notebook: hist_plot.ipynb <hist_plot.ipynb>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    Keywords: matplotlib code example, codex, python plot, pyplot
    `Gallery generated by Sphinx-Gallery
    <https://sphinx-gallery.readthedocs.io>`_
