.. 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_lines_bars_and_markers_errorbar_limits_simple.py: =============== Errorbar Limits =============== Illustration of upper and lower limit symbols on errorbars .. code-block:: python import numpy as np import matplotlib.pyplot as plt .. code-block:: python fig = plt.figure(0) x = np.arange(10.0) y = np.sin(np.arange(10.0) / 20.0 * np.pi) plt.errorbar(x, y, yerr=0.1) y = np.sin(np.arange(10.0) / 20.0 * np.pi) + 1 plt.errorbar(x, y, yerr=0.1, uplims=True) y = np.sin(np.arange(10.0) / 20.0 * np.pi) + 2 upperlimits = np.array([1, 0] * 5) lowerlimits = np.array([0, 1] * 5) plt.errorbar(x, y, yerr=0.1, uplims=upperlimits, lolims=lowerlimits) plt.xlim(-1, 10) .. image:: /gallery/lines_bars_and_markers/images/sphx_glr_errorbar_limits_simple_000.png :class: sphx-glr-single-img .. code-block:: python fig = plt.figure(1) x = np.arange(10.0) / 10.0 y = (x + 0.1)**2 plt.errorbar(x, y, xerr=0.1, xlolims=True) y = (x + 0.1)**3 plt.errorbar(x + 0.6, y, xerr=0.1, xuplims=upperlimits, xlolims=lowerlimits) y = (x + 0.1)**4 plt.errorbar(x + 1.2, y, xerr=0.1, xuplims=True) plt.xlim(-0.2, 2.4) plt.ylim(-0.1, 1.3) plt.show() .. image:: /gallery/lines_bars_and_markers/images/sphx_glr_errorbar_limits_simple_002.png :class: sphx-glr-single-img .. _sphx_glr_download_gallery_lines_bars_and_markers_errorbar_limits_simple.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download :download:`Download Python source code: errorbar_limits_simple.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: errorbar_limits_simple.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature Keywords: matplotlib code example, codex, python plot, pyplot `Gallery generated by Sphinx-Gallery `_