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

Examples

open allclose all

Basic Examples  (5)

Plot the vector field with color indicating the vector magnitude:

Include a legend for the vector magnitudes:

Use a drop-shaped marker to represent the vectors:

Use a multi-panel layout to show multiple vector fields at the same time:

Use a log scale for the x axis:

Reverse the y scale so it increases toward the bottom:

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:

Plot multiple vector fields:

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:

Include a legend:

Use no color:

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:

Use a log scale for the x axis:

Reverse the y scale so it increases toward the bottom:

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:

Turn each axis on individually:

AxesLabel  (3)

No axes labels are drawn by default:

Place a label on the axis:

Specify axes labels:

AxesOrigin  (2)

The position of the axes is determined automatically:

Specify an explicit origin for the axes:

AxesStyle  (4)

Change the style for the axes:

Specify the style of each axis:

Use different styles for the ticks and the axes:

Use different styles for the labels and the axes:

Background  (1)

Use colored backgrounds:

ClippingStyle  (4)

Vectors are clipped via VectorRange. The default clipping style is automatically chosen:

Do not show clipped vectors:

Specify the style for clipped vectors:

Color upper and lower clipped vectors differently:

EvaluationMonitor  (2)

Show where the vector field function is sampled:

Count the number of times the vector field function is evaluated:

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:

Use maximum sizes for the width and height:

PlotLayout  (2)

Place each group of vectors in a separate panel using shared axes:

Use a row instead of a column:

Use multiple columns or rows:

Prefer full columns or rows:

PlotLegends  (4)

No legends are included by default:

Include a legend to show the color range of vector norms:

Include a legend for multiple fields:

Control the placement of the legend:

PlotRange  (5)

The full plot range is used by default:

Specify an explicit limit for both and ranges:

Specify an explicit range:

Specify an explicit maximum range:

Specify different and ranges:

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:

Specify a style for the boundary:

Specify a style for full rectangular regions:

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:

Specify a style for the interior filling:

Specify a style for full rectangular region:

RegionFunction  (4)

Plot vectors only over a certain region:

Modify the method by which field points are generated to better reflect the boundary of the region:

Plot vectors only over regions where the field magnitude is above a given threshold:

Use any logical combination of conditions:

ScalingFunctions  (2)

Use a log scale for the x axis:

Reverse the y scale so it increases toward the bottom:

VectorAspectRatio  (2)

The default aspect ratio for a vector marker is 1/4:

Increase the relative width of a vector marker:

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)

Vectors are drawn as arrows by default:

Use a named appearance to draw the vectors:

Use different markers for different vector fields:

By default, markers are centered on vector points:

Start the vectors at the points:

End the vectors at the points:

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:

Use "Mesh" to better represent the boundary of a region:

VectorRange  (4)

The clipping of vectors with very small or very large magnitudes is done automatically:

Specify the range of vector norms:

Suppress the clipped vectors:

Show all the vectors:

VectorScaling  (2)

Use automatically determined vector scales:

With the vector scaling function set to None, all vectors have the same size:

VectorSizes  (2)

The sizes of the displayed vectors are determined automatically:

Specify the range of arrow lengths:

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)

Hamiltonian vector field of :

Direction Fields  (2)

Plot the direction field for the logistic differential equation :

Give the segments a common color:

Add several solution curves with a uniform color:

Plot the direction field for a differential equation that is only defined over a specific subset of the -plane, :

Stability  (2)

Characterize linear planar systems interactively:

Use vectors to indicate the stability of a limit cycle:

Gradients  (1)

Gradient field of over the unit square:

Physics  (2)

Show the direction field for a frictionless pendulum satisfying :

Display the electric field for two point charges:

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:

Wolfram Research (2008), VectorPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/VectorPlot.html (updated 2022).

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

BibTeX

@misc{reference.wolfram_2024_vectorplot, author="Wolfram Research", title="{VectorPlot}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/VectorPlot.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_vectorplot, organization={Wolfram Research}, title={VectorPlot}, year={2022}, url={https://reference.wolfram.com/language/ref/VectorPlot.html}, note=[Accessed: 21-November-2024 ]}