:orphan:



.. _sphx_glr_plot_types:

.. _plot_types:

.. redirect-from:: /tutorials/basic/sample_plots

Plot types
==========

Overview of many common plotting commands in Matplotlib.

Note that we have stripped all labels, but they are present by default.
See the `gallery <../gallery/index.html>`_ for many more examples and
the `tutorials page <../tutorials/index.html>`_ for longer examples.

.. raw:: html

    <div class="sphx-glr-clear"></div>



.. _sphx_glr_plot_types_basic:

.. _basic_plots:

Basic
-----

Basic plot types, usually y versus x.


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.plot.">

.. only:: html

 .. figure:: /plot_types/basic/images/thumb/sphx_glr_plot_thumb.png
     :alt: plot(x, y)

     :ref:`sphx_glr_plot_types_basic_plot.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/basic/plot

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.scatter.">

.. only:: html

 .. figure:: /plot_types/basic/images/thumb/sphx_glr_scatter_plot_thumb.png
     :alt: scatter(x, y)

     :ref:`sphx_glr_plot_types_basic_scatter_plot.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/basic/scatter_plot

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.bar / ~matplotlib.axes.Axes.barh.">

.. only:: html

 .. figure:: /plot_types/basic/images/thumb/sphx_glr_bar_thumb.png
     :alt: bar(x, height) / barh(y, width)

     :ref:`sphx_glr_plot_types_basic_bar.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/basic/bar

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.stem.">

.. only:: html

 .. figure:: /plot_types/basic/images/thumb/sphx_glr_stem_thumb.png
     :alt: stem(x, y)

     :ref:`sphx_glr_plot_types_basic_stem.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/basic/stem

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.step.">

.. only:: html

 .. figure:: /plot_types/basic/images/thumb/sphx_glr_step_thumb.png
     :alt: step(x, y)

     :ref:`sphx_glr_plot_types_basic_step.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/basic/step

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.fill_between.">

.. only:: html

 .. figure:: /plot_types/basic/images/thumb/sphx_glr_fill_between_thumb.png
     :alt: fill_between(x, y1, y2)

     :ref:`sphx_glr_plot_types_basic_fill_between.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/basic/fill_between
.. raw:: html

    <div class="sphx-glr-clear"></div>



.. _sphx_glr_plot_types_arrays:

.. _array_plots:

Plots of arrays and fields
--------------------------

Plotting for arrays of data ``Z(x, y)`` and fields ``U(x, y), V(x, y)``.


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.imshow.">

.. only:: html

 .. figure:: /plot_types/arrays/images/thumb/sphx_glr_imshow_thumb.png
     :alt: imshow(Z)

     :ref:`sphx_glr_plot_types_arrays_imshow.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/arrays/imshow

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="~.axes.Axes.pcolormesh is more flexible than ~.axes.Axes.imshow in that the x and y vectors nee...">

.. only:: html

 .. figure:: /plot_types/arrays/images/thumb/sphx_glr_pcolormesh_thumb.png
     :alt: pcolormesh(X, Y, Z)

     :ref:`sphx_glr_plot_types_arrays_pcolormesh.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/arrays/pcolormesh

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.contour.">

.. only:: html

 .. figure:: /plot_types/arrays/images/thumb/sphx_glr_contour_thumb.png
     :alt: contour(X, Y, Z)

     :ref:`sphx_glr_plot_types_arrays_contour.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/arrays/contour

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.contourf.">

.. only:: html

 .. figure:: /plot_types/arrays/images/thumb/sphx_glr_contourf_thumb.png
     :alt: contourf(X, Y, Z)

     :ref:`sphx_glr_plot_types_arrays_contourf.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/arrays/contourf

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.barbs.">

.. only:: html

 .. figure:: /plot_types/arrays/images/thumb/sphx_glr_barbs_thumb.png
     :alt: barbs(X, Y, U, V)

     :ref:`sphx_glr_plot_types_arrays_barbs.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/arrays/barbs

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.quiver.">

.. only:: html

 .. figure:: /plot_types/arrays/images/thumb/sphx_glr_quiver_thumb.png
     :alt: quiver(X, Y, U, V)

     :ref:`sphx_glr_plot_types_arrays_quiver.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/arrays/quiver

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.streamplot.">

.. only:: html

 .. figure:: /plot_types/arrays/images/thumb/sphx_glr_streamplot_thumb.png
     :alt: streamplot(X, Y, U, V)

     :ref:`sphx_glr_plot_types_arrays_streamplot.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/arrays/streamplot
.. raw:: html

    <div class="sphx-glr-clear"></div>



.. _sphx_glr_plot_types_stats:

.. _stats_plots:

Statistics plots
----------------

Plots for statistical analysis.


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.hist.">

.. only:: html

 .. figure:: /plot_types/stats/images/thumb/sphx_glr_hist_plot_thumb.png
     :alt: hist(x)

     :ref:`sphx_glr_plot_types_stats_hist_plot.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/stats/hist_plot

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.boxplot.">

.. only:: html

 .. figure:: /plot_types/stats/images/thumb/sphx_glr_boxplot_plot_thumb.png
     :alt: boxplot(X)

     :ref:`sphx_glr_plot_types_stats_boxplot_plot.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/stats/boxplot_plot

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.errorbar.">

.. only:: html

 .. figure:: /plot_types/stats/images/thumb/sphx_glr_errorbar_plot_thumb.png
     :alt: errorbar(x, y, yerr, xerr)

     :ref:`sphx_glr_plot_types_stats_errorbar_plot.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/stats/errorbar_plot

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.violinplot.">

.. only:: html

 .. figure:: /plot_types/stats/images/thumb/sphx_glr_violin_thumb.png
     :alt: violinplot(D)

     :ref:`sphx_glr_plot_types_stats_violin.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/stats/violin

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.eventplot.">

.. only:: html

 .. figure:: /plot_types/stats/images/thumb/sphx_glr_eventplot_thumb.png
     :alt: eventplot(D)

     :ref:`sphx_glr_plot_types_stats_eventplot.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/stats/eventplot

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.hist2d.">

.. only:: html

 .. figure:: /plot_types/stats/images/thumb/sphx_glr_hist2d_thumb.png
     :alt: hist2d(x, y)

     :ref:`sphx_glr_plot_types_stats_hist2d.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/stats/hist2d

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.hexbin.">

.. only:: html

 .. figure:: /plot_types/stats/images/thumb/sphx_glr_hexbin_thumb.png
     :alt: hexbin(x, y, C)

     :ref:`sphx_glr_plot_types_stats_hexbin.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/stats/hexbin

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.pie.">

.. only:: html

 .. figure:: /plot_types/stats/images/thumb/sphx_glr_pie_thumb.png
     :alt: pie(x)

     :ref:`sphx_glr_plot_types_stats_pie.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/stats/pie
.. raw:: html

    <div class="sphx-glr-clear"></div>



.. _sphx_glr_plot_types_unstructured:

.. _unstructured_plots:

Unstructured coordinates
-------------------------

Sometimes we collect data ``z`` at coordinates ``(x,y)`` and want to visualize
as a contour.  Instead of gridding the data and then using 
`~.axes.Axes.contour`, we can use a triangulation algorithm and fill the 
triangles.


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.tricontour.">

.. only:: html

 .. figure:: /plot_types/unstructured/images/thumb/sphx_glr_tricontour_thumb.png
     :alt: tricontour(x, y, z)

     :ref:`sphx_glr_plot_types_unstructured_tricontour.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/unstructured/tricontour

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.tricontourf.">

.. only:: html

 .. figure:: /plot_types/unstructured/images/thumb/sphx_glr_tricontourf_thumb.png
     :alt: tricontourf(x, y, z)

     :ref:`sphx_glr_plot_types_unstructured_tricontourf.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/unstructured/tricontourf

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.tripcolor.">

.. only:: html

 .. figure:: /plot_types/unstructured/images/thumb/sphx_glr_tripcolor_thumb.png
     :alt: tripcolor(x, y, z)

     :ref:`sphx_glr_plot_types_unstructured_tripcolor.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/unstructured/tripcolor

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See ~matplotlib.axes.Axes.triplot.">

.. only:: html

 .. figure:: /plot_types/unstructured/images/thumb/sphx_glr_triplot_thumb.png
     :alt: triplot(x, y)

     :ref:`sphx_glr_plot_types_unstructured_triplot.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /plot_types/unstructured/triplot
.. raw:: html

    <div class="sphx-glr-clear"></div>



.. only :: html

 .. container:: sphx-glr-footer
    :class: sphx-glr-footer-gallery


  .. container:: sphx-glr-download sphx-glr-download-python

    :download:`Download all examples in Python source code: plot_types_python.zip </plot_types/plot_types_python.zip>`



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

    :download:`Download all examples in Jupyter notebooks: plot_types_jupyter.zip </plot_types/plot_types_jupyter.zip>`


.. 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>`_
