.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/mplot3d/errorbar3d.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_mplot3d_errorbar3d.py: ============ 3D errorbars ============ An example of using errorbars with upper and lower limits in mplot3d. .. GENERATED FROM PYTHON SOURCE LINES 8-30 .. image:: /gallery/mplot3d/images/sphx_glr_errorbar3d_001.png :alt: errorbar3d :class: sphx-glr-single-img .. code-block:: default import matplotlib.pyplot as plt import numpy as np ax = plt.figure().add_subplot(projection='3d') # setting up a parametric curve t = np.arange(0, 2*np.pi+.1, 0.01) x, y, z = np.sin(t), np.cos(3*t), np.sin(5*t) estep = 15 i = np.arange(t.size) zuplims = (i % estep == 0) & (i // estep % 3 == 0) zlolims = (i % estep == 0) & (i // estep % 3 == 2) ax.errorbar(x, y, z, 0.2, zuplims=zuplims, zlolims=zlolims, errorevery=estep) ax.set_xlabel("X label") ax.set_ylabel("Y label") ax.set_zlabel("Z label") plt.show() .. _sphx_glr_download_gallery_mplot3d_errorbar3d.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: errorbar3d.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: errorbar3d.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature Keywords: matplotlib code example, codex, python plot, pyplot `Gallery generated by Sphinx-Gallery `_