.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/statistics/errorbar.py" .. LINE NUMBERS ARE GIVEN BELOW. .. 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_gallery_statistics_errorbar.py: ================= Errorbar function ================= This exhibits the most basic use of the error bar method. In this case, constant values are provided for the error in both the x- and y-directions. .. GENERATED FROM PYTHON SOURCE LINES 10-21 .. image:: /gallery/statistics/images/sphx_glr_errorbar_001.png :alt: errorbar :class: sphx-glr-single-img .. code-block:: default import numpy as np import matplotlib.pyplot as plt # example data x = np.arange(0.1, 4, 0.5) y = np.exp(-x) fig, ax = plt.subplots() ax.errorbar(x, y, xerr=0.2, yerr=0.4) plt.show() .. _sphx_glr_download_gallery_statistics_errorbar.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: errorbar.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: errorbar.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature Keywords: matplotlib code example, codex, python plot, pyplot `Gallery generated by Sphinx-Gallery `_