
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "plot_types/3D/trisurf3d_simple.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_plot_types_3D_trisurf3d_simple.py>`
        to download the full example code.

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

.. _sphx_glr_plot_types_3D_trisurf3d_simple.py:


=====================
plot_trisurf(x, y, z)
=====================

See `~mpl_toolkits.mplot3d.axes3d.Axes3D.plot_trisurf`.

.. GENERATED FROM PYTHON SOURCE LINES 8-36

.. code-block:: Python

    import matplotlib.pyplot as plt
    import numpy as np

    from matplotlib import cm

    plt.style.use('_mpl-gallery')

    n_radii = 8
    n_angles = 36

    # Make radii and angles spaces
    radii = np.linspace(0.125, 1.0, n_radii)
    angles = np.linspace(0, 2*np.pi, n_angles, endpoint=False)[..., np.newaxis]

    # Convert polar (radii, angles) coords to cartesian (x, y) coords.
    x = np.append(0, (radii*np.cos(angles)).flatten())
    y = np.append(0, (radii*np.sin(angles)).flatten())
    z = np.sin(-x*y)

    # Plot
    fig, ax = plt.subplots(subplot_kw={'projection': '3d'})
    ax.plot_trisurf(x, y, z, vmin=z.min() * 2, cmap=cm.Blues)

    ax.set(xticklabels=[],
           yticklabels=[],
           zticklabels=[])

    plt.show()


.. _sphx_glr_download_plot_types_3D_trisurf3d_simple.py:

.. only:: html

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

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

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

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

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

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

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


.. only:: html

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

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