pyFM.viz.plot_arrows

pyFM.viz.plot_arrows(points, vfield, *, color='black', cmap='viridis', clim=None, rescale=1.0, scale_by_norm=True, tolerance=None, show_colorbar=False, opacity=1.0, pl=None, return_plot=False)

Plot a vector field as arrows.

Each arrow starts at a point of points and is oriented along the matching row of vfield.

Parameters:
  • points (np.ndarray - (p,3) or (3,) base point of each arrow)

  • vfield (np.ndarray - (p,3) or (3,) vector carried by each arrow)

  • color (str - a fixed color name for every arrow, or the special value) – "magnitude" to color each arrow by its norm through cmap

  • cmap (str - matplotlib colormap name, used when color is "magnitude")

  • clim ((2,) - color limits, used when color is "magnitude")

  • rescale (float - global scale factor for arrow length)

  • scale_by_norm (bool - if True arrow length is proportional to the vector norm, otherwise) – every arrow has the same length

  • tolerance (float - merge points closer than this fraction of the bounding box, to draw) – fewer arrows

  • show_colorbar (bool - display the color bar)

  • opacity (float - opacity of the arrows)

  • pl (pyvista.Plotter - returned when pl was given or return_plot is True.)

  • return_plot (bool - return the plotter instead of showing it)

  • Output

  • ------------------------------

  • pl – Otherwise the plot is shown and None is returned.

Examples using plot_arrows

Geometry of a triangle mesh

Geometry of a triangle mesh