.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "tutorial/03_figures/exercises/a_display_options.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via Binder .. rst-class:: sphx-glr-example-title .. _sphx_glr_tutorial_03_figures_exercises_a_display_options.py: Display Options ~~~~~~~~~~~~~~~ Take a look at the different display options offered by the ``add_mesh`` method. .. GENERATED FROM PYTHON SOURCE LINES 7-17 .. code-block:: Python import pyvista as pv from pyvista import examples mesh = examples.load_random_hills() p = pv.Plotter() p.add_mesh(mesh) p.show() .. GENERATED FROM PYTHON SOURCE LINES 18-20 Let's take a look at some different options for the ``add_mesh`` method to alter how the above data are displayed. .. GENERATED FROM PYTHON SOURCE LINES 20-22 .. code-block:: Python help(p.add_mesh) .. GENERATED FROM PYTHON SOURCE LINES 23-24 Plot that mesh with the edges of cells displayed .. GENERATED FROM PYTHON SOURCE LINES 24-28 .. code-block:: Python p = pv.Plotter() p.add_mesh(mesh, ...) p.show() .. GENERATED FROM PYTHON SOURCE LINES 29-31 Plot that mesh with the colored edges and as a show the surface as a solid color (use a named color!) .. GENERATED FROM PYTHON SOURCE LINES 31-35 .. code-block:: Python p = pv.Plotter() p.add_mesh(mesh, ...) p.show() .. GENERATED FROM PYTHON SOURCE LINES 36-37 Display with a points representation style .. GENERATED FROM PYTHON SOURCE LINES 37-41 .. code-block:: Python p = pv.Plotter() p.add_mesh(mesh, ...) p.show() .. GENERATED FROM PYTHON SOURCE LINES 42-43 And adjust the points display size .. GENERATED FROM PYTHON SOURCE LINES 43-47 .. code-block:: Python p = pv.Plotter() p.add_mesh(mesh, ...) p.show() .. GENERATED FROM PYTHON SOURCE LINES 48-49 Change the color map and the color limits .. GENERATED FROM PYTHON SOURCE LINES 49-53 .. code-block:: Python p = pv.Plotter() p.add_mesh(mesh, ...) p.show() .. GENERATED FROM PYTHON SOURCE LINES 54-55 Add some opacity .. GENERATED FROM PYTHON SOURCE LINES 55-59 .. code-block:: Python p = pv.Plotter() p.add_mesh(mesh, ...) p.show() .. GENERATED FROM PYTHON SOURCE LINES 60-61 There you go! Those are a few of the most commonly used display options! .. GENERATED FROM PYTHON SOURCE LINES 63-70 .. raw:: html
Open In Colab
.. _sphx_glr_download_tutorial_03_figures_exercises_a_display_options.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/pyvista/pyvista-tutorial/gh-pages?urlpath=lab/tree/notebooks/tutorial/03_figures/exercises/a_display_options.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: a_display_options.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: a_display_options.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_