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, quiver plot and direction plot.
- VectorPlot displays a vector field by drawing arrows normalized to a fixed length. The arrows are colored by default according to the magnitude of the vector field.
- The plot visualizes the set .
- 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: [List of all options]
-
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 PlotLayout Automatic how to position fields 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 ScalingFunctions None how to scale individual coordinates 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:
- Possible settings for PlotLayout that show single groups of vectors in multiple plot panels include:
-
"Column" use separate groups of vectors in a column of panels "Row" use separate groups of vectors in a row of panels {"Column",k},{"Row",k} use k columns or rows {"Column",UpTo[k]},{"Row",UpTo[k]} use at most k columns or rows - 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}].
- Possible settings for ScalingFunctions are:
-
{sx,sy} scale x and y axes - Common built-in scaling functions s include:
-
"Log" log scale with automatic tick labeling "Log10" base-10 log scale with powers of 10 for ticks "SignedLog" log-like scale that includes 0 and negative numbers "Reverse" reverse the coordinate direction "Infinite" infinite scale -
AlignmentPoint Center the default point in the graphic to align with AspectRatio 1 ratio of height to width Axes False whether to draw axes AxesLabel None axes labels AxesOrigin Automatic where axes should cross AxesStyle {} style specifications for the axes Background None background color for the plot BaselinePosition Automatic how to align with a surrounding text baseline BaseStyle {} base style specifications for the graphic ClippingStyle Automatic how to display arrows outside the vector range ContentSelectable Automatic whether to allow contents to be selected CoordinatesToolOptions Automatic detailed behavior of the coordinates tool Epilog {} primitives rendered after the main plot EvaluationMonitor None expression to evaluate at every function evaluation FormatType TraditionalForm the default format type for text Frame True whether to draw a frame around the plot FrameLabel None frame labels FrameStyle {} style specifications for the frame FrameTicks Automatic frame tick marks FrameTicksStyle {} style specifications for frame ticks GridLines None grid lines to draw GridLinesStyle {} style specifications for grid lines ImageMargins 0. the margins to leave around the graphic ImagePadding All what extra padding to allow for labels etc. ImageSize Automatic the absolute size at which to render the graphic LabelStyle {} style specifications for labels Method Automatic methods to use for the plot PerformanceGoal $PerformanceGoal aspects of performance to try to optimize PlotLabel None an overall label for the plot PlotLayout Automatic how to position fields PlotLegends None legends to include PlotRange {Full,Full} range of x, y values to include PlotRangeClipping False whether to clip at the plot range PlotRangePadding Automatic how much to pad the range of values PlotRegion Automatic the final display region to be filled PlotTheme $PlotTheme overall theme for the plot PreserveImageOptions Automatic whether to preserve image options when displaying new versions of the same graphic Prolog {} primitives rendered before the main plot RegionBoundaryStyle Automatic how to style plot region boundaries RegionFillingStyle Automatic how to style plot region interiors RegionFunction (True&) determine what region to include RotateLabel True whether to rotate y labels on the frame ScalingFunctions None how to scale individual coordinates Ticks Automatic axes ticks TicksStyle {} style specifications for axes ticks 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
List of all options
Examples
open allclose allBasic Examples (5)
Scope (24)
Sampling (9)
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:
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 (15)
Plot a vector field with automatically scaled arrows:
Use a single color for the arrows:
Plot a vector field with arrows of specified size:
Draw the arrows starting from the sample points:
Draw the arrows without the arrowheads:
Change the overall shape of the markers:
Change the default color function:
Show multiple functions as densities in separate panels:
Use a column instead of a row:
Set the style for multiple vector fields:
VectorColorFunction takes precedence over colors in VectorStyle:
Set VectorColorFunctionNone to specify colors with VectorStyle:
Include a legend for multiple vector fields:
Use a theme with simple ticks and grid lines:
Options (97)
AspectRatio (4)
By default, AspectRatio uses the same width and height:
Use a numerical value to specify the height to width ratio:
AspectRatioAutomatic determines the ratio from the plot ranges:
AspectRatioFull adjusts the height and width to tightly fit inside the image size:
Axes (4)
By default, Axes are not drawn:
Use AxesTrue to turn on axes:
Use AxesOrigin to specify where the axes intersect:
AxesOrigin (2)
AxesStyle (4)
ClippingStyle (4)
Vectors are clipped via VectorRange. The default clipping style is automatically chosen:
EvaluationMonitor (2)
ImageSize (5)
Use named sizes such as Tiny, Small, Medium and Large:
Specify the width of the plot:
Specify the height of the plot:
Allow the width and height to be up to a certain size:
Specify the width and height for a graphic, padding with space if necessary:
Setting AspectRatioFull will fill the image size:
PlotLayout (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)
ScalingFunctions (2)
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 (13)
Use StreamPlot to plot with streamlines instead of vectors:
Use ListVectorPlot or ListStreamPlot for plotting data:
Use VectorDensityPlot to add a density plot of the scalar field:
Use StreamDensityPlot to plot streamlines instead of vectors:
Use ListVectorDensityPlot or ListStreamDensityPlot for plotting data:
Use LineIntegralConvolutionPlot to plot the line integral convolution of a vector field:
Use VectorDisplacementPlot to visualize the effect of a displacement vector field on a specified region:
Use ListVectorDisplacementPlot to visualize the effect of displacement field data on a region:
Use VectorPlot3D and StreamPlot3D to visualize 3D vector fields:
Use ListVectorPlot3D or ListStreamPlot3D to plot with data:
Plot vectors on surfaces with SliceVectorPlot3D:
Plot data vectors on surfaces with ListSliceVectorPlot3D:
Plot complex functions as a vector field with ComplexVectorPlot:
Plot streams instead of vectors with ComplexStreamPlot:
Use VectorDisplacementPlot3D to visualize the effect of a displacement vector field on a specified 3D region:
Use ListVectorDisplacementPlot3D to visualize the effect of 3D displacement vector field data on a specified region:
Use GeoVectorPlot to generate a vector plot over the Earth:
Use GeoStreamPlot to use streams instead of vectors:
Text
Wolfram Research (2008), VectorPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/VectorPlot.html (updated 2022).
CMS
Wolfram Language. 2008. "VectorPlot." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. 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