PyVista env

1. Basic operations

You can check pyvista configuration:

import pyvista as pv
pv.start_xvfb()
pv.Report()
Results
Out[1]:

--------------------------------------------------------------------------------
  Date: Fri Oct 04 09:44:36 2024 UTC

                  OS : Linux (Ubuntu 24.04)
              CPU(s) : 4
             Machine : x86_64
        Architecture : 64bit
                 RAM : 15.6 GiB
         Environment : IPython
         File system : ext4
          GPU Vendor : Mesa/X.org
        GPU Renderer : llvmpipe (LLVM 15.0.6, 256 bits)
         GPU Version : 4.5 (Core Profile) Mesa 22.3.2
    MathText Support : True

  Python 3.12.3 (main, Sep 11 2024, 14:17:37) [GCC 13.2.0]

             pyvista : 0.44.1
                 vtk : 9.3.1
               numpy : 1.26.4
          matplotlib : 3.9.2
              scooby : 0.10.0
               pooch : 1.8.2
              pillow : 10.2.0
             imageio : 2.35.1
             IPython : 8.28.0
            colorcet : 3.1.0
             cmocean : 4.0.3
          ipywidgets : 8.1.5
               scipy : 1.11.4
              meshio : 5.3.5
               trame : 3.6.5
        trame_client : 3.3.2
        trame_server : 3.2.3
           trame_vtk : 2.8.10
       trame_vuetify : 2.7.1
jupyter_server_proxy : 4.4.0
        nest_asyncio : 1.6.0
--------------------------------------------------------------------------------

Here is a small example to plot a sphere:

sphere = pv.Sphere()

# short example
sphere.plot(jupyter_backend='client')
Results
# long example
plotter = pv.Plotter(notebook=True)
plotter.add_mesh(sphere)
plotter.show(jupyter_backend='trame')

2. Viewing Mesh with PyVista

pv.set_jupyter_backend('client')
mesh = pv.Plane().triangulate()
submesh = mesh.subdivide(2, 'linear')
submesh.plot(show_edges=True, cpos='xy', interactive=False)