code: def plot_beam(notebook=None):
      """Plot a beam with displacement.
  
      Parameters
      ----------
      notebook : bool, optional
          When ``True``, the resulting plot is placed inline a jupyter
          notebook.  Assumes a jupyter console is active.
  
      Examples
      --------
      >>> from pyvista import demos
      >>> demos.plot_beam()
  
      """
      # Create fiticious displacements as a function of Z location
      grid = examples.load_hexbeam()
      d = grid.points[:, 2] ** 3 / 250
      grid.points[:, 1] += d
  
      # Camera position
      cpos = [
          (11.915126303095157, 6.11392754955802, 3.6124956735471914),
          (0.0, 0.375, 2.0),
          (
              -0.42546442225230097,
              0.9024244135964158,
              -0.06789847673314177,
          ),
      ]
  
      cmap = "bwr"
  
      # plot this displaced beam
      plotter = pyvista.Plotter(notebook=notebook)
      plotter.add_mesh(
          grid,
          scalars=d,
          scalar_bar_args={"title": "Y Displacement"},
          rng=[-d.max(), d.max()],
          cmap=cmap,
      )
      plotter.camera_position = cpos
      plotter.add_text("Static Beam Example")
      plotter.show()
  
file_path: pyvista/pyvista/demos/demos.py
imports: import time
  import numpy
  import pyvista
  from pyvista import examples
  from .logo import text_3d
label_desc: Use image node_id 7 for calling a global function with example usage: plot_beam(notebook) without return types