({{, (RefLink[ListVectorPlot, paclet:ref/ListVectorPlot])[array] 
generates a vector plot from an array of vector field values.}, {, (RefLink[ListVectorPlot, paclet:ref/ListVectorPlot])[{{{(Subscript[x, 1]),(Subscript[y, 1])},{(Subscript[vx, 1]),(Subscript[vy, 1])}},…}]
generates a vector plot from vector field values {(Subscript[vx, i]),(Subscript[vy, i])} given at specified points {(Subscript[x, i]),(Subscript[y, i])}.}, {, (RefLink[ListVectorPlot, paclet:ref/ListVectorPlot])[{(Subscript[data, 1]),(Subscript[data, 2]),…}]
plots data for several vector fields. }})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[ListVectorPlot, paclet:ref/ListVectorPlot])[array] arranges successive rows of array up the page, and successive columns across.

(RefLink[ListVectorPlot, paclet:ref/ListVectorPlot]) by default interpolates the data given and plots vectors for the vector field at a regular grid of positions.

With the setting (RefLink[VectorPoints, paclet:ref/VectorPoints])->(RefLink[All, paclet:ref/All]), (RefLink[ListVectorPlot, paclet:ref/ListVectorPlot]) instead shows vectors associated with the particular vector field data points given.

(RefLink[ListVectorPlot, paclet:ref/ListVectorPlot]) has the same options as (RefLink[Graphics, paclet:ref/Graphics]), with the following additions and changes:

The arguments supplied to functions in (RefLink[RegionFunction, paclet:ref/RegionFunction]) and (RefLink[VectorColorFunction, paclet:ref/VectorColorFunction]) are x, y, (Subscript[v, x]), (Subscript[v, y]), (RefLink[Norm, paclet:ref/Norm])[{(Subscript[v, x]),(Subscript[v, y])}].

OpenersPrimaryExamplesSection(Spacer1)Examples  (117)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Plot the vector field interpolated from a specified set of vectors:

ListVectorPlot[Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}]]

Plot the vector field from data specifying coordinates and vectors:

data = Table[{{x,y},{y,x-x^3}},{x,-1.5,1.5,0.2},{y,-2,2,0.2}];

ListVectorPlot[data]

OpenersExampleSection1(Spacer1)Scope  (16)

OpenersExampleSubsection0(Spacer1)Sampling  (7)

Plot vectors for a regular collection of vectors, and give a data range for the domain:

ListVectorPlot[Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}],DataRange->{{-3,3},{-3,3}}]

Plot an irregular collection of vectors:

data=Table[{{x,y}=RandomReal[{-3,3},{2}],{y,-x}},{200}];

ListVectorPlot[data]

Show all of the specified field vectors:

ListVectorPlot[data,VectorPoints->All]

Explicitly set the number of vectors in each direction:

ListVectorPlot[data,VectorPoints->{4,7}]

Plot two vector fields:

data1=Table[{{x,y}=RandomReal[{-3,3},{2}],{y,-x}},{200}];
data2=Table[{{x,y}=RandomReal[{-3,3},{2}],{y^2,x-y}},{200}];

ListVectorPlot[{data1,data2}]

Specify a list of points for showing field vectors:

ListVectorPlot[Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}],DataRange->{{-3,3},{-3,3}},VectorScale->Large,VectorPoints->RandomReal[{-3,3},{300,2}]]

Plot a vector field with vectors placed with specified densities:

data=Table[{y,-x},{x,-2,2,0.2},{y,-2,2,0.2}];

Table[ListVectorPlot[data,PlotLabel->p, VectorPoints->p],{p,{5,Coarse,Automatic,Fine}}]

Plot the vectors that go through a set of seed points:

points = {{-1,-1},{-1,1},{1,-1},{1,1}};
data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,DataRange->{{-3,3},{-3,3}},VectorPoints->points,VectorScale->.25,Epilog->{Red,PointSize[Medium],Point[points]}]

Plot vectors over a specified region:

ListVectorPlot[Table[{{x,y}=RandomReal[{-3,3},{2}],{y,-x}},{200}],RegionFunction->Function[{x,y,vx,vy,n},x y<0]]

OpenersExampleSubsection1(Spacer1)Presentation  (9)

Plot a vector field with constant size arrows:

ListVectorPlot[Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}],VectorScale->{Automatic,Automatic,None}]

Plot a vector field with arrows of specified size:

data=Table[{x,-y},{x,-3,3,0.2},{y,-3,3,0.2}];

Table[ListVectorPlot[data,VectorColorFunction->"BrightBands",PlotLabel->s,VectorScale->s], {s,{Small,Medium,Large,0.15}}]

Vary the arrow length and arrowhead size:

data=Table[{Sin[x],Cos[y]},{x,-Pi,Pi,0.2},{y,-Pi,Pi,0.2}];

Table[ListVectorPlot[data,PlotLabel->s,VectorScale->s],{s,{{Large,1},{Large,Scaled[1]},{Large,Automatic,#1&}}}]

Plot a vector field with arrows colored according to the magnitude of the field:

ListVectorPlot[Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}],VectorColorFunction->"Rainbow"]

Set the style for multiple vector fields:

data1=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];
data2=Table[{-(1+x-y^2),-1-x^2+y},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[{data1,data2},VectorPoints->8,VectorStyle->{{Orange,"Drop"},{Green,"Dart"}}]

Apply vector style:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,VectorPoints->8,VectorStyle->Arrowheads[{{0.03,Automatic,Graphics[Circle[]]}}]]

Use a named appearance to draw the vectors:

data=Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,VectorMarkers->"Drop"]

Style the vectors as well:

ListVectorPlot[data,VectorMarkers->"Drop",VectorStyle->Red]

Use a theme with more detail:

data1=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];
data2=Table[{-(1+x-y^2),-1-x^2+y},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[{data1,data2},PlotTheme->"Detailed"]

Combine the theme with a specific style for the vectors:

ListVectorPlot[{data1,data2},PlotTheme->"Detailed",VectorStyle->"Dart"]

Plot vectors and streamlines together:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,VectorStyle->Red,StreamPoints->10]

OpenersExampleSection2(Spacer1)Options  (89)

OpenersExampleSubsection2(Spacer1)AspectRatio  (2)

By default, the aspect ratio is 1:

ListVectorPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.15},{y,-3,3,0.2}],AspectRatio->1]

Set the aspect ratio:

Table[ListVectorPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.15},{y,-3,3,0.2}],PlotLabel->a,AspectRatio->a],{a,{Automatic,Full,GoldenRatio}}]

OpenersExampleSubsection3(Spacer1)Background  (1)

Use colored backgrounds:

ListVectorPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],VectorStyle->Yellow,FrameStyle->LightGray,Background->Black]

OpenersExampleSubsection4(Spacer1)DataRange  (1)

By default, the data range is taken to be the index range of the data array:

data=Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.3}];
Dimensions[data]

ListVectorPlot[data]

Specify the data range for the domain:

ListVectorPlot[data,DataRange->{{-3,3},{-3,3}}]

OpenersExampleSubsection5(Spacer1)EvaluationMonitor  (1)

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

Block[{k=0},ListVectorPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],EvaluationMonitor:>k++];k]

OpenersExampleSubsection6(Spacer1)FrameLabel  (1)

Label the frame:

ListVectorPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],FrameLabel->{x,y}]

OpenersExampleSubsection7(Spacer1)PerformanceGoal  (2)

Generate a higher-quality plot:

ListVectorPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],PerformanceGoal->"Quality"]

Emphasize performance, possibly at the cost of quality:

ListVectorPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],PerformanceGoal->"Speed"]

OpenersExampleSubsection8(Spacer1)PlotLegends  (1)

Add legends with placeholder text:

data1=Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}];
data2=Table[{x,y},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[{data1,data2},PlotLegends->Automatic]

Specify labels for the legend:

ListVectorPlot[{data1,data2},PlotLegends->{"one","two"}]

Place the legend below the plot:

ListVectorPlot[{data1,data2},PlotLegends->Placed[{"one","two"},Below]]

Control the appearance of the legend:

ListVectorPlot[{data1,data2},PlotLegends->SwatchLegend[{"one","two"},LegendMarkerSize->{20,10}]]

OpenersExampleSubsection9(Spacer1)PlotRange  (8)

The full plot range is used by default:

ListVectorPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],PlotRange->Full]

Specify an explicit limit for both x and y ranges:

ListVectorPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],DataRange->{{-3,3},{-3,3}},PlotRange->2]

Specify an explicit range that applies to both x and y ranges:

ListVectorPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],DataRange->{{-3,3},{-3,3}},PlotRange->{-1,2.5}]

Specify an explicit x range:

ListVectorPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],DataRange->{{-3,3},{-3,3}},PlotRange->{{-1,2}}]

Specify an explicit x minimum range:

ListVectorPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],DataRange->{{-3,3},{-3,3}},PlotRange->{{0,Full}}]

Specify an explicit y range:

ListVectorPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],DataRange->{{-3,3},{-3,3}},PlotRange->{Full,{0,2}}]

Specify an explicit y maximum range:

ListVectorPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],DataRange->{{-3,3},{-3,3}},PlotRange->{Full,{Full,5}}]

Specify different x and y ranges:

ListVectorPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],DataRange->{{-3,3},{-3,3}},PlotRange->{{-2,1.5},{-1,2}}]

OpenersExampleSubsection10(Spacer1)PlotTheme  (1)

Use a theme with axes, frame, and brighter colors:

data=RandomReal[{-1,1},{30,30,2,2}];

ListVectorPlot[data,PlotTheme->"Scientific",VectorPoints->RandomReal[{-1,1},{250,2}]]

Change the vector style:

ListVectorPlot[data,PlotTheme->"Scientific",VectorPoints->RandomReal[{-1,1},{250,2}],VectorStyle->Black]

OpenersExampleSubsection11(Spacer1)RegionFunction  (3)

Plot vectors only over certain quadrants:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,DataRange->{{-3,3},{-3,3}},RegionFunction->Function[{x,y,vx,vy,n},x y<0]]

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

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,DataRange->{{-3,3},{-3,3}},RegionFunction->Function[{x,y,vx,vy,n},n>6]]

Use any logical combination of conditions:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,DataRange->{{-3,3},{-3,3}},RegionFunction->Function[{x,y,vx,vy,n},4<n<9||0<n<2]]

OpenersExampleSubsection12(Spacer1)StreamColorFunction  (5)

Color streamlines according to the norm of the vector field:

ListVectorPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],StreamPoints->Coarse,StreamColorFunction->Hue]

Use any named color gradient from (RefLink[ColorData, paclet:ref/ColorData]):

ListVectorPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],StreamPoints->Coarse,StreamColorFunction->"ValentineTones"]

Use (RefLink[ColorData, paclet:ref/ColorData]) for predefined color gradients:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,StreamPoints->Coarse,StreamColorFunction->Function[{x,y,vx,vy,n},ColorData["SolarColors"][x y]]]

Specify a color function that blends two colors by the x coordinate:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,StreamPoints->Coarse,StreamColorFunction->Function[{x,y,vx,vy,n},Blend[{Green,Red},x]]]

Use (RefLink[StreamColorFunctionScaling, paclet:ref/StreamColorFunctionScaling])->(RefLink[False, paclet:ref/False]) to get unscaled values:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,StreamColorFunctionScaling->False,StreamPoints->Coarse,StreamColorFunction->Function[{x,y,vx,vy,n},ColorData[22][Round[n]]]]

OpenersExampleSubsection13(Spacer1)StreamColorFunctionScaling  (4)

By default, scaled values are used:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,StreamPoints->Fine,StreamColorFunction->Function[{x,y,vx,vy,n},Blend[{Green,Red},x]]]

Use (RefLink[StreamColorFunctionScaling, paclet:ref/StreamColorFunctionScaling])->(RefLink[False, paclet:ref/False]) to get unscaled values:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,StreamPoints->Fine,StreamColorFunctionScaling->False,StreamColorFunction->Function[{x,y,vx,vy,n},ColorData[22][Round[n]]]]

Use unscaled coordinates in the x direction and scaled coordinates in the y direction:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,StreamPoints->Fine,StreamColorFunction->Function[{x,y,vx,vy,n},Hue[x,y,1]],StreamColorFunctionScaling->{False,True}]

Explicitly specify the scaling for each color function argument:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,StreamPoints->Fine,StreamColorFunction->Function[{x,y,vx,vy,n},Hue[n,y,1]],StreamColorFunctionScaling->{True,True,True,True,False}]

OpenersExampleSubsection14(Spacer1)StreamPoints  (6)

Specify a maximum number of streamlines:

ListVectorPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],StreamPoints->10]

Use symbolic names to specify the number of streamlines:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

Table[ListVectorPlot[data,VectorStyle->Orange,StreamPoints->p,PlotLabel->p],{p,{Automatic,Coarse,Fine}}]

Use both automatic and explicit seeding with styles for explicitly seeded streamlines:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,DataRange->{{-3,3},{-3,3}},StreamStyle->Gray,StreamPoints->{{{{1,0},Red},{{-1,-1},Green},Automatic}}]

Specify the minimum distance between streamlines:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

Table[ListVectorPlot[data,PlotLabel->d,VectorStyle->Orange,StreamPoints->{Automatic,d}],{d,{Automatic,1,Scaled[0.05]}}]

Specify the minimum distance between streamlines at the start and end of a streamline:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

Table[ListVectorPlot[data,PlotLabel->d,VectorStyle->Orange,StreamPoints->{Automatic,d}],{d,{Automatic,{Scaled[0.1],Scaled[0.5]}}}]

Control the maximum length that each streamline can have:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];
points = Tuples[{-1,0,1},2]

Table[ListVectorPlot[data,DataRange->{{-3,3},{-3,3}},VectorStyle->Orange,StreamPoints->{points,Automatic,maxlen},Epilog->Point[points]],{maxlen,{2.5,Scaled[0.2]}}]

OpenersExampleSubsection15(Spacer1)StreamScale  (9)

Create full streamlines without segmentation:

ListVectorPlot[Table[{Sin[x],Cos[y]},{x,-Pi,Pi,0.2},{y,-Pi,Pi,0.2}],VectorStyle->Orange,StreamPoints->10,StreamScale->Full]

Use curves for streamlines:

ListVectorPlot[Table[{Sin[x],Cos[y]},{x,-Pi,Pi,0.2},{y,-Pi,Pi,0.2}],VectorStyle->Orange,StreamPoints->10,StreamScale->None]

Use symbolic names to control the lengths of streamlines:

data=Table[{Sin[x],Cos[y]},{x,-Pi,Pi,0.2},{y,-Pi,Pi,0.2}];

Table[ListVectorPlot[data,PlotLabel->s,VectorPoints->8,VectorStyle->Orange,StreamPoints->Coarse,StreamScale->s],{s,{Tiny,Large}}]

Specify segment lengths:

data=Table[{Sin[x],Cos[y]},{x,-Pi,Pi,0.2},{y,-Pi,Pi,0.2}];

Table[ListVectorPlot[data,PlotLabel->s,VectorPoints->8,VectorStyle->Orange,StreamPoints->Coarse,StreamScale->s],{s,{0.1,0.2,0.4}}]

Specify an explicit dashing pattern for streamlines:

data=Table[{Sin[x],Cos[y]},{x,-Pi,Pi,0.2},{y,-Pi,Pi,0.2}];

ListVectorPlot[data,VectorPoints->8,VectorStyle->Orange,StreamPoints->Coarse,StreamScale->{{0.1,0.1},Automatic}]

Specify the number of points rendered on each streamline segment:

data=Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}];

Table[ListVectorPlot[data,PlotLabel->n,VectorStyle->Orange,StreamPoints->Coarse,StreamScale->{Full,n}],{n,{10,All}}]

Specify absolute aspect ratios relative to the longest line segment:

data=Table[{Sin[x],Cos[y]},{x,-Pi,Pi,0.2},{y,-Pi,Pi,0.2}];

Table[ListVectorPlot[data,VectorPoints->8,VectorStyle->Orange,StreamPoints->Coarse,PlotLabel->a,StreamScale->{Automatic,Automatic,a}],{a,{.02,.04}}]

Specify relative aspect ratios relative to each line segment:

data=Table[{Sin[x],Cos[y]},{x,-Pi,Pi,0.2},{y,-Pi,Pi,0.2}];

Table[ListVectorPlot[data,VectorPoints->8,VectorStyle->Orange,StreamPoints->Coarse,PlotLabel->a,StreamScale->{Automatic,Automatic,a}],{a,{Scaled[0.5],Scaled[1],Scaled[1.5]}}]

Scale the length of the arrows by the y coordinate:

data=Table[{Sin[x],Cos[y]},{x,-Pi,Pi,0.2},{y,-Pi,Pi,0.2}];

ListVectorPlot[data,VectorScale->Tiny,VectorStyle->Orange,StreamPoints->Coarse,StreamScale->{Automatic,2,Automatic,Function[{x,y,vx,vy,n},Scaled[y]]}]

OpenersExampleSubsection16(Spacer1)StreamStyle  (8)

Apply a variety of styles to the streamlines:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

Table[ListVectorPlot[data,StreamPoints->Coarse,StreamScale->Full,StreamStyle->s],{s,{Orange,Thick,Directive[Orange,Thick]}}]

Specify a custom arrowhead:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,StreamPoints->Coarse,StreamScale->Full,StreamStyle->Arrowheads[{{0.03,Automatic,Graphics[Circle[]]}}]]

Set the style for multiple vector fields:

data1=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];
data2=Table[{-(1+x-y^2),-1-x^2+y},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[{data1,data2},StreamPoints->20,StreamStyle->{Red,Blue}]

Use named styles:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

Table[ListVectorPlot[data,PlotLabel->s,StreamPoints->Coarse,StreamScale->{Full,All,0.05},StreamStyle->s],{s,{"Segment","Line"}}]

Named arrow styles:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

Table[ListVectorPlot[data,PlotLabel->s,StreamPoints->Coarse,StreamScale->{Full,All,0.05},StreamStyle->s],{s,{"Arrow","ArrowArrow","CircleArrow"}}]

Named dot styles:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

Table[ListVectorPlot[data,PlotLabel->s,StreamScale->{Full,All,0.03},StreamPoints->Coarse,StreamStyle->s],{s,{"BarDot","Dot","DotArrow","DotDot"}}]

Named pointer styles:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

Table[ListVectorPlot[data,PlotLabel->s,StreamScale->{Full,All,0.03},StreamPoints->Coarse,StreamStyle->s],{s,{"Drop","BackwardPointer","Pointer","Toothpick"}}]

Named dart styles:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

Table[ListVectorPlot[data,PlotLabel->s,StreamScale->{Full,All,0.03},StreamPoints->Coarse,StreamStyle->s],{s,{"Dart","PinDart","DoubleDart"}}]

OpenersExampleSubsection17(Spacer1)VectorColorFunction  (4)

Color the vectors according to their norms:

data=Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,VectorScale->Large,VectorColorFunction->Hue]

Use any named color gradient from (RefLink[ColorData, paclet:ref/ColorData]):

data=Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,VectorScale->Large,VectorColorFunction->"Rainbow"]

Color the vectors according to their x values:

data=Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,VectorScale->Large,VectorColorFunction->Function[{x,y,vx,vy,n},ColorData["ThermometerColors"][x]]]

Use (RefLink[VectorColorFunctionScaling, paclet:ref/VectorColorFunctionScaling])->(RefLink[False, paclet:ref/False]) to get unscaled values:

data=Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,VectorScale->Large,VectorColorFunction->Function[{x,y,vx,vy,n},ColorData[22][Round[n]]],VectorColorFunctionScaling->False]

OpenersExampleSubsection18(Spacer1)VectorColorFunctionScaling  (4)

By default, scaled values are used:

ListVectorPlot[Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}],VectorScale->Large,VectorColorFunction->Hue]

Use (RefLink[VectorColorFunctionScaling, paclet:ref/VectorColorFunctionScaling])->(RefLink[False, paclet:ref/False]) to get unscaled values:

data=Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,VectorScale->Large,VectorColorFunction->Function[{x,y,vx,vy,n},ColorData[22][Round[n]]],VectorColorFunctionScaling->False]

Use unscaled coordinates in the x direction and scaled coordinates in the y direction:

data=Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,VectorScale->Large,VectorColorFunction->Function[{x,y,vx,vy,n},Hue[x,y,1]], VectorColorFunctionScaling->{False,True}]

Explicitly specify the scaling for each color function argument:

data=Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,VectorScale->Large,VectorColorFunction->Function[{x,y,vx,vy,n},Hue[n,y,1]], VectorColorFunctionScaling->{True,True,True,True,False}]

OpenersExampleSubsection19(Spacer1)VectorMarkers  (4)

Vectors are drawn as arrows by default:

data=Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data]

Use a named appearance to draw the vectors:

data=Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,VectorMarkers->"Drop"]

Use different markers for different vector fields:

data1=Table[{{x,y},{y,-x}},{x,-5,5},{y,-5,5}];
data2=Table[{{x,y},{x,y}},{x,-5,5},{y,-5,5}];

ListVectorPlot[{data1,data2},VectorMarkers->{"Drop","Dart"}]

By default, markers are centered on vector points:

data=Table[{{x,y},{y,-x}},{x,-5,5},{y,-5,5}];

pts=Tuples[Range[-5,5],2];

ListVectorPlot[data,VectorMarkers->"Arrow",VectorPoints->pts,Epilog->{Red,Point[pts]}]

Start the vectors at the points:

ListVectorPlot[data,VectorMarkers->Placed["Arrow","Start"],VectorPoints->pts,Epilog->{Red,Point[pts]}]

End the vectors at the points:

ListVectorPlot[data,VectorMarkers->Placed["Arrow","End"],VectorPoints->pts,Epilog->{Red,Point[pts]}]

OpenersExampleSubsection20(Spacer1)VectorPoints  (8)

Use automatically determined vector points:

ListVectorPlot[Table[{y,-x},{x,-1,1,0.2},{y,-1,1,0.2}],VectorPoints->Automatic]

Show all of the specified field vectors:

ListVectorPlot[Table[{y,-x},{x,-1,1,0.2},{y,-1,1,0.2}],VectorPoints->All]

Use symbolic names to specify the set of field vectors:

data=Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}];

Table[ListVectorPlot[data,PlotLabel->k,VectorPoints->k],{k,{Fine,Coarse}}]

Create a regular grid of field vectors with the same number of arrows for x and y:

ListVectorPlot[Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}],VectorPoints->5]

Create a regular grid of field vectors with a different number of arrows for x and y:

ListVectorPlot[Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}], VectorPoints->{4,7}]

Specify a list of points for showing field vectors:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,DataRange->{{-3,3},{-3,3}},VectorPoints->RandomReal[{-3,3},{300,2}],VectorScale->Large]

Use a different number of field vectors on a regular grid:

data=Table[{y^2,x^2-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];

Table[ListVectorPlot[data,PlotLabel->n,VectorPoints->n,VectorScale->Medium],{n,5,20,5}]

The location for vectors is given in the middle of the drawn vector:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];
points = {{-1,-1},{-1,1},{1,-1},{1,1}};

ListVectorPlot[data,DataRange->{{-2,2},{-2,2}},VectorPoints->points,VectorScale->.25,Epilog->{Red,PointSize[Medium],Point[points]}]

OpenersExampleSubsection21(Spacer1)VectorScale  (9)

Use an automatically determined vector scale:

ListVectorPlot[Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}],DataRange->{{-3,3},{-3,3}},VectorScale->Automatic]

Specify the relative size of vectors as a fraction of the diagonal of the plot range:

data=Table[{Sin[x],Cos[y]},{x,-Pi,Pi,0.2},{y,-Pi,Pi,0.2}];

Table[ListVectorPlot[data,VectorPoints->10,PlotLabel->s,VectorScale->s],{s,{0.05,0.1}}]

Use symbolic names to control the size of vectors:

data=Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}];

Table[ListVectorPlot[data,VectorScale->s,PlotLabel->s],{s,{Tiny,Small,Medium,Large}}]

With the vector scaling function set to (RefLink[None, paclet:ref/None]), then all vectors have the same size:

data=Table[{Sin[x],Cos[y]},{x,-Pi,Pi,0.2},{y,-Pi,Pi,0.2}];

Table[ListVectorPlot[data,PlotLabel->ToString[f],VectorScale->{Automatic,Automatic,f}],{f,{None,Automatic}}]

Specify an absolute size for the arrowheads:

ListVectorPlot[Table[{Sin[x],Cos[y]},{x,-Pi,Pi,0.2},{y,-Pi,Pi,0.2}],VectorScale->{Large,1}]

Specify arrowhead size relative to the length of the arrow:

ListVectorPlot[Table[{Sin[x],Cos[y]},{x,-Pi,Pi,0.2},{y,-Pi,Pi,0.2}],VectorScale->{Large,Scaled[1]}]

Scale the vector length by the absolute value of the x coordinate:

ListVectorPlot[Table[{Sin[x],Cos[y]},{x,-Pi,Pi,0.2},{y,-Pi,Pi,0.2}],VectorScale->{Large,Automatic,#1&}]

By default, the vector length is scaled by the norm of the vector field:

data=Table[{Sin[x],Cos[y]},{x,-Pi,Pi,0.2},{y,-Pi,Pi,0.2}];

Table[ListVectorPlot[data,PlotLabel->len,VectorScale->{Large, Automatic, len}],{len,{Automatic,#5&}}]

Scale the vector length by the x component of the vector field:

data=Table[{1/(x^2+y^2),1/(x^2+y^2)},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[data,VectorScale->{Automatic,Automatic,#},PlotLabel->HoldForm[#]]& /@ {None,Function[If[#5>1,None,#5]]}

OpenersExampleSubsection22(Spacer1)VectorStyle  (7)

Set the style for the displayed vectors:

ListVectorPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],VectorPoints->8,VectorStyle->Red]

Set the style for multiple vector fields:

data1=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];
data2=Table[{-(1+x-y^2),-1-x^2+y},{x,-3,3,0.2},{y,-3,3,0.2}];

ListVectorPlot[{data1,data2},VectorPoints->8,VectorStyle->{Red,Blue}]

Plot the vector fields without arrowheads:

ListVectorPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],VectorPoints->8,VectorStyle->Arrowheads[0]]

Use (RefLink[Arrowheads, paclet:ref/Arrowheads]) to specify an explicit style of the arrowheads:

data=Table[{x,y},{x,-1,1,0.2},{y,-1,1,0.2}];

ListVectorPlot[data,VectorPoints->8,PlotRange->All,VectorStyle->Arrowheads[{{0.03,Automatic,Graphics[Circle[]]}}]]

Specify both arrow tail and head:

data=Table[{x,y},{x,-1,1,0.2},{y,-1,1,0.2}];

ListVectorPlot[data,VectorPoints->8,PlotRange->All, VectorStyle->Arrowheads[{{0.03,Automatic,Graphics[Rectangle[{-0.5,-0.5},{0.5,0.5}]]},{0.03,Automatic,Graphics[Circle[]]}}]]

Graphics primitives without (RefLink[Arrowheads, paclet:ref/Arrowheads]) are scaled based on the vector scale:

data=Table[{x,y},{x,-1,1,0.2},{y,-1,1,0.2}];

ListVectorPlot[data,VectorPoints->8,PlotRange->All, VectorStyle->Graphics[Circle[]]]

Change the scaling using the (RefLink[VectorScale, paclet:ref/VectorScale]) option:

data=Table[{x,y},{x,-1,1,0.2},{y,-1,1,0.2}];

ListVectorPlot[data,VectorPoints->8,PlotRange->All, VectorStyle->Graphics[Circle[]], VectorScale->{Automatic,Scaled[0.3]}]

OpenersExampleSection3(Spacer1)Applications  (4)

Hamiltonian vector field of sin(x y):

data=Table[Evaluate@{D[Sin[x y],{y}],-D[Sin[x y],{x}]}, {x, 0, 2Pi}, {y, 0, 2Pi}];

ListVectorPlot[data]

Visualize the first horizontal and vertical Gaussian derivatives of an image:

image=ColorConvert[Rasterize[π,ImageSize->40],"Grayscale"]

{dx,dy}=Table[ImageAdjust@GaussianFilter[image,{6,2}, δ],{δ,{{1,0},{0,1}}}]

Combine the vertical and horizontal Gaussian derivatives:

data=Reverse/@Transpose[2ImageData/@{dx,dy}-1,{3,2,1}];

ListVectorPlot[data,VectorPoints->30]

Current wind directions across Italy:

vectors=ListVectorPlot[Table[{{x,y},-Through[{Sin,Cos}[WeatherData[{y,x},"WindDirection"]]]},{x,6,18,3},{y,36,48,3}]]

Generate a polygonal representation of Italy:

g=Graphics[{GrayLevel[.7],CountryData["Italy","Polygon"]}]

Combine outline and vectors:

Show[g,vectors]

Characterize linear planar systems interactively:

Manipulate[Row[{Text["m"]==MatrixForm[m],ListVectorPlot[Table[Evaluate[m.{x,y}],{x,-1,1},{y,-1,1}], VectorScale->{Large,Scaled[1.2]}, VectorColorFunction->"Rainbow",ImageSize->Small]}],{{m,(({{1, 0}, {0, 2}}))}, {(({{1, 0}, {0, 2}}))->"Nodal source",(({{1, 1}, {0, 1}}))->"Degenerate source",(({{0, 1}, {-1, 1}}))->"Spiral source",(({{-1, 0}, {0, -2}}))->"Nodal sink",(({{-1, 1}, {0, -1}}))->"Degenerate sink",(({{0, 1}, {-1, -1}}))->"Spiral sink",(({{0, 1}, {-1, 0}}))->"Center",(({{1, 0}, {0, -2}}))->"Saddle"}}]

OpenersExampleSection4(Spacer1)Properties & Relations  (6)

Use (RefLink[VectorPlot, paclet:ref/VectorPlot]) to plot functions:

VectorPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},VectorPoints->8]

Use (RefLink[ListStreamPlot, paclet:ref/ListStreamPlot]) to plot data with streamlines instead of vectors:

ListStreamPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}]]

Use (RefLink[ListVectorDensityPlot, paclet:ref/ListVectorDensityPlot]) for plotting data with a density plot of the scalar field:

data=Table[{{x,y}=RandomReal[{-1.5,1.5},{2}],{{y,x-x^3},Abs[x+y]}},{300}];

ListVectorDensityPlot[data,VectorPoints->8,ColorFunction->"Pastel"]

Use (RefLink[VectorDensityPlot, paclet:ref/VectorDensityPlot]) to plot functions with a density plot of the scalar field:

VectorDensityPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},VectorPoints->8]

Use (RefLink[ListLineIntegralConvolutionPlot, paclet:ref/ListLineIntegralConvolutionPlot]) to plot the line integral convolution of vector field data:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,.2},{y,-3,3,.2}];

ListLineIntegralConvolutionPlot[data]

Use (RefLink[ListVectorPlot3D, paclet:ref/ListVectorPlot3D]) to visualize 3D vector field data:

ListVectorPlot3D[Table[{x,y,z},{x,-1,1,.1},{y,-1,1,.1},{z,-1,1,.1}]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[ListStreamPlot, paclet:ref/ListStreamPlot])  ▪  (RefLink[ListStreamDensityPlot, paclet:ref/ListStreamDensityPlot])  ▪  (RefLink[VectorPlot, paclet:ref/VectorPlot])  ▪  (RefLink[ListVectorPlot3D, paclet:ref/ListVectorPlot3D])  ▪  (RefLink[ListSliceVectorPlot3D, paclet:ref/ListSliceVectorPlot3D])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Vector Visualization, paclet:guide/VectorVisualization])}, {▪(RefLinkPlain[Vector Analysis, paclet:guide/VectorAnalysis])}, {▪(RefLinkPlain[Data Visualization, paclet:guide/DataVisualization])}})}})