VectorPlot
VectorPlot[{vx,vy},{x,xmin,xmax},{y,ymin,ymax}]
generates a vector plot of the vector field {vx,vy} as a function of x and y.
VectorPlot[{{vx,vy},{wx,wy},…},{x,xmin,xmax},{y,ymin,ymax}]
plots several vector fields.
VectorPlot[…,{x,y}∈reg]
takes the variables {x,y} to be in the geometric region reg.
Details and Options




- VectorPlot is also known as field plot and direction plot.
- VectorPlot displays a vector field by drawing arrows. By default the direction of the vector is indicated by the direction of the arrow, and the magnitude is indicated by its color.
- VectorPlot omits any arrows for which the vi etc. do not evaluate to real numbers.
- The region reg can be any RegionQ object in 2D.
- VectorPlot treats the variables x and y as local, effectively using Block.
- VectorPlot has attribute HoldAll, and evaluates the vi etc. only after assigning specific numerical values to x and y. In some cases it may be more efficient to use Evaluate to evaluate the vi etc. symbolically first.
- VectorPlot has the same options as Graphics, with the following additions and changes:
-
AspectRatio 1 ratio of height to width ClippingStyle Automatic how to display arrows outside the vector range EvaluationMonitor None expression to evaluate at every function evaluation Frame True whether to draw a frame around the plot FrameTicks Automatic frame tick marks Method Automatic methods to use for the plot PerformanceGoal $PerformanceGoal aspects of performance to try to optimize PlotLegends None legends to include PlotRange {Full,Full} range of x, y values to include PlotRangePadding Automatic how much to pad the range of values PlotTheme $PlotTheme overall theme for the plot RegionBoundaryStyle Automatic how to style plot region boundaries RegionFillingStyle Automatic how to style plot region interiors RegionFunction True& determine what region to include VectorAspectRatio Automatic width to length ratio for arrows VectorColorFunction Automatic how to color arrows VectorColorFunctionScaling True whether to scale the argument to VectorColorFunction VectorMarkers Automatic shape to use for arrows VectorPoints Automatic the number or placement of arrows VectorRange Automatic range of vector lengths to show VectorScaling None how to scale the sizes of arrows VectorSizes Automatic sizes of displayed arrows VectorStyle Automatic how to style arrows WorkingPrecision MachinePrecision precision to use in internal computations - The individual arrows are scaled to fit inside bounding circles around each point.
- VectorScaling scales the magnitudes of the vectors into the range of arrow sizes smin to smax given by VectorSizes.
- VectorScaling->Automatic will scale the arrow lengths depending on the vector magnitudes:
- The arrow markers given by VectorMarkers are drawn inside a box whose width and length are in the proportion
specified by VectorAspectRatio.
- Common markers include:
-
"Segment" line segment aligned in the field direction "PinDart" pin dart aligned along the field "Dart" dart-shaped marker "Drop" drop-shaped marker - VectorColorFunction->None will draw the arrows with the style specified by VectorStyle.
- The arguments supplied to functions in RegionFunction and VectorColorFunction are x, y, vx, vy, Norm[{vx,vy}].



Examples
open allclose allBasic Examples (3)
Scope (19)
Sampling (10)
Plot a vector field with vectors placed with specified densities:
Sample the vector field on a regular grid of points:
Sample the vector field on an irregular mesh:
Specify how many vector points to use in each direction:
Plot the vectors that go through a set of seed points:
Increase the number of points in an alternate point generation scheme:
Plot vectors over a specified region:
The domain may be specified by a region:
The domain may be specified by a MeshRegion:
Use Evaluate to evaluate the vector field symbolically before numeric assignment:
Presentation (9)
Plot a vector field with automatically scaled arrows:
Use a single color for the arrows:
Plot a vector field with arrows of specified size:
Change the overall shape of the markers:
Change the default color function:
VectorColorFunction takes precedence over colors in VectorStyle:
Set VectorColorFunctionNone to specify colors with VectorStyle:
Options (74)
ClippingStyle (4)
Vectors are clipped via VectorRange. The default clipping style is automatically chosen:
EvaluationMonitor (2)
PlotLegends (4)
PlotRange (5)
PlotTheme (1)
Use a theme with detailed ticks and axes:
Add automatic GridLines:
RegionBoundaryStyle (6)
Show the region being plotted:
Show the region defined by a region function:
The boundaries of full rectangular regions are not shown:
Use None to not show the boundary:
Omit the interior filling as well:
RegionFillingStyle (6)
Show the region being plotted:
Show the region defined by a region function:
The interior of full rectangular regions are not shown:
Use None to not show the interior filling:
Omit the boundary curve as well:
RegionFunction (4)
VectorAspectRatio (2)
VectorColorFunction (4)
Color the vectors according to their norms:
Use any named color gradient from ColorData:
Color the vectors according to their values:
Use VectorColorFunctionScalingFalse to get unscaled values:
VectorColorFunctionScaling (4)
By default, scaled values are used:
Use VectorColorFunctionScalingFalse to get unscaled values:
Use unscaled coordinates in the direction and scaled coordinates in the
direction:
Explicitly specify the scaling for each color function argument:
VectorMarkers (4)
VectorPoints (10)
Use automatically determined vector points:
Use symbolic names to specify the set of field vectors:
Create a hexagonal grid of field vectors with the same number of arrows for and
:
Create a hexagonal grid of field vectors with a different number of arrows for and
:
Specify a list of points for showing field vectors:
Use a different number of field vectors on a hexagonal grid:
The location for vectors is given in the middle of the drawn vector:
Use a rectangular mesh instead of a hexagonal mesh:
Use a mesh generated from a triangularization of the region:
VectorRange (4)
VectorScaling (2)
Use automatically determined vector scales:
With the vector scaling function set to None, all vectors have the same size:
VectorSizes (2)
VectorStyle (6)
Set the style for the displayed vectors:
Set the style for multiple vector fields:
Use Arrowheads to specify an explicit style of the arrowheads:
Specify both arrow tail and head:
Graphics primitives without Arrowheads are scaled based on the vector scale:
Change the scaling using the VectorScaling option:
Applications (8)
Direction Fields (2)
Stability (2)
Properties & Relations (8)
Use ListVectorPlot for plotting data:
Use StreamPlot to plot with streamlines instead of vectors:
Use VectorDensityPlot to add a density plot of the scalar field:
Use ListVectorDensityPlot for plotting data with a density plot of the scalar field:
Use LineIntegralConvolutionPlot to plot the line integral convolution of a vector field:
Use VectorPlot3D to visualize 3D vector fields:
Plot vectors on surfaces with SliceVectorPlot3D:
Text
Wolfram Research (2008), VectorPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/VectorPlot.html (updated 2020).
BibTeX
BibLaTeX
CMS
Wolfram Language. 2008. "VectorPlot." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/VectorPlot.html.
APA
Wolfram Language. (2008). VectorPlot. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VectorPlot.html