The vectorplot
module provides a method for visualizing vector / dyadic fields on meshes. These functions produce Graphics objects that can be displayed with Show
.
To use the module, first import it:
import vectorplot
Visualizes a vector Field
object:
var g = plotvectorfield(field)
Plotfield accepts a number of optional arguments to control what is displayed:
dl
- Sets the size of the vectors. Default is1
.aspectratio
- Sets the aspect ratio of the arrows / cylinders representing the field. Default is0.3
.noarrows
- A Boolean variable to indicate whether you want the arrowheads to be drawn. Default isfalse
. This can be set totrue
to visualize dyadic / nematic fields that have a head/tail symmetry.sparsity
- A number between 0 and 1 to indicate the fraction of vectors to plot. Default is1
.showmesh
- A Boolean to indicate whether or not to plot the mesh with the vectors. Default istrue
.colormap
- AColorMap
object to use for coloring the arrows. If not provided,ViridisMap
is used as the default. Note that a constantColor
object can also be used as a colormap, as it just matches all values to the same color.scale
- A Boolean to indicate whether or not to scale the colors by the bounds of the colormap. Default istrue
.scalebar
- AScalebar
object to use.colorby
- Argument to control the color of the arrows. See belowfilter
andtransmit
- Used by thepovray
module to indicate transparency.
Supported colorby
arguments:
default
- Color all vectors by the same color.norm
- Color by the magnitude of the vector fieldsx
- Color by the x-coordinate of the vector fieldsy
orz
- Color by the y or z components, similar tox
.