<jupyter_start><jupyter_text>Plot Vector Component=====================Plot a single component of a vector as a scalar array.We can plot individual components of multi-component arrays with the`component` argument of the `add_mesh` method.<jupyter_code>import pyvista as pv
from pyvista import examples<jupyter_output><empty_output><jupyter_text>Download an example notched beam stress<jupyter_code>mesh = examples.download_notch_displacement()<jupyter_output><empty_output><jupyter_text>The default behavior with no component specified is to use the vectormagnitude. We can access each component by specifying the componentargument.<jupyter_code>dargs = dict(
    scalars="Nodal Displacement",
    cmap="jet",
    show_scalar_bar=False,
)

pl = pv.Plotter(shape=(2, 2))
pl.subplot(0, 0)
pl.add_mesh(mesh, **dargs)
pl.add_text("Normalized Displacement", color='k')
pl.subplot(0, 1)
pl.add_mesh(mesh.copy(), component=0, **dargs)
pl.add_text("X Displacement", color='k')
pl.subplot(1, 0)
pl.add_mesh(mesh.copy(), component=1, **dargs)
pl.add_text("Y Displacement", color='k')
pl.subplot(1, 1)
pl.add_mesh(mesh.copy(), component=2, **dargs)
pl.add_text("Z Displacement", color='k')
pl.link_views()
pl.camera_position = 'iso'
pl.background_color = 'white'
pl.show()<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup