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

.. only:: html

    .. meta::
        :keywords: codex

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

        :ref:`Go to the end <sphx_glr_download_gallery_mplot3d_fillbetween3d.py>`
        to download the full example code.

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

.. _sphx_glr_gallery_mplot3d_fillbetween3d.py:


=====================
Fill between 3D lines
=====================

Demonstrate how to fill the space between 3D lines with surfaces. Here we
create a sort of "lampshade" shape.

.. GENERATED FROM PYTHON SOURCE LINES 9-30

.. code-block:: Python


    import matplotlib.pyplot as plt
    import numpy as np

    N = 50
    theta = np.linspace(0, 2*np.pi, N)

    x1 = np.cos(theta)
    y1 = np.sin(theta)
    z1 = 0.1 * np.sin(6 * theta)

    x2 = 0.6 * np.cos(theta)
    y2 = 0.6 * np.sin(theta)
    z2 = 2  # Note that scalar values work in addition to length N arrays

    fig = plt.figure()
    ax = fig.add_subplot(projection='3d')
    ax.fill_between(x1, y1, z1, x2, y2, z2, alpha=0.5, edgecolor='k')

    plt.show()


.. GENERATED FROM PYTHON SOURCE LINES 31-35

.. tags::
   plot-type: 3D,
   plot-type: fill_between,
   level: beginner


.. _sphx_glr_download_gallery_mplot3d_fillbetween3d.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example

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

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

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

      :download:`Download Python source code: fillbetween3d.py <fillbetween3d.py>`

    .. container:: sphx-glr-download sphx-glr-download-zip

      :download:`Download zipped: fillbetween3d.zip <fillbetween3d.zip>`


.. only:: html

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

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
