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

OpenersNotesSection(Spacer1)Details and Options

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

(RefLink[ListStreamPlot, paclet:ref/ListStreamPlot]) plots streamlines that show the local direction of the vector field at every point.

(RefLink[ListStreamPlot, paclet:ref/ListStreamPlot]) by default interpolates the data given and shows enough streamlines to achieve a roughly uniform density throughout the plot.

(RefLink[ListStreamPlot, paclet:ref/ListStreamPlot]) 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[StreamColorFunction, paclet:ref/StreamColorFunction]) are x, y, (Subscript[v, x]), (Subscript[v, y]), (RefLink[Norm, paclet:ref/Norm])[{(Subscript[v, x]),(Subscript[v, y])}].

OpenersPrimaryExamplesSection(Spacer1)Examples  (135)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Plot streamlines computed from the interpolation of a specified set of vectors:

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

ListStreamPlot[data]

Plot the streamlines from data specifying coordinates and vectors:

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

ListStreamPlot[data]

OpenersExampleSection1(Spacer1)Scope  (21)

OpenersExampleSubsection0(Spacer1)Sampling  (9)

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

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

Plot streamlines for an irregular collection of vectors:

ListStreamPlot[Table[{{x,y}=RandomReal[{-3,3},2],{-1-x^2+y,1+x-y^2}},{200}]]

Plot streamlines for several vector fields:

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

ListStreamPlot[{data1,data2}]

Plot a vector field with streamlines placed with specified densities:

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

Table[ListStreamPlot[data,StreamScale->None,PlotLabel->p, StreamPoints->p],{p,{Coarse, Medium, Automatic, Fine}}]

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

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

ListStreamPlot[data,DataRange->{{-3,3},{-3,3}},StreamPoints->Tuples[{-1,0,1},2],Epilog->Point[Tuples[{-1,0,1},2]]]

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

ListStreamPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],DataRange->{{-3,3},{-3,3}},StreamPoints->{{{{1,0},Red},{{-1,-1},Green},Automatic}}]

Plot streamlines over a specified region:

ListStreamPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],DataRange->{{-3,3},{-3,3}},RegionFunction->Function[{x,y,vx,vy,n},x y<0]]

Use a specific number of mesh lines:

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

Specify specific mesh lines:

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

OpenersExampleSubsection1(Spacer1)Presentation  (12)

Specify different dashings and arrowheads by settings to (RefLink[StreamScale, paclet:ref/StreamScale]):

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

Table[ListStreamPlot[data,PlotLabel->ToString@s,StreamScale->s],{s,{Automatic,None,Full}}]

Plot the streamlines with arrows colored according to the magnitude of the field:

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

Apply a variety of streamline styles:

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

Table[ListStreamPlot[data,StreamScale->Full,StreamStyle->s],{s,{"Toothpick","Dart",Directive[Orange,Dashed],Arrowheads[{{0.03,Automatic,Graphics[Circle[]]}}]}}]

Style streamlines for multiple vector fields:

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

ListStreamPlot[{data1,data2},StreamStyle->{Blue,Purple}]

Use a named appearance to draw the streamlines:

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

ListStreamPlot[data,StreamMarkers->"Drop"]

Style the streamlines as well:

ListStreamPlot[data,StreamMarkers->"Drop",StreamStyle->Red]

Plot vectors and streamlines together:

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

Specify mesh lines with different styles:

ListStreamPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],Mesh->{{{2,Thick},{4,Green},{5,{Thick,Red,Dashed}}}}]

Specify global mesh line styles:

Table[ListStreamPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],Mesh->10,MeshStyle->s],{s,{Red,Thick,Directive[Red,Dashed]}}]

Shade mesh regions cyclically:

ListStreamPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],Mesh->10,MeshShading->{Red,Yellow,Green,None}]

Apply a variety of styles to region boundaries:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];regionFn=Function[{x,y,vx,vy,n},4<n<6||0<n<2];

Table[ListStreamPlot[data,RegionFunction->regionFn,BoundaryStyle->b],{b,{Red,Thick,Directive[Red,Dashed]}}]

Use a theme with simple ticks and grid lines:

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

Use a theme with detailed ticks and fine stream style:

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

OpenersExampleSection2(Spacer1)Options  (101)

OpenersExampleSubsection2(Spacer1)AspectRatio  (2)

By default, the aspect ratio is 1:

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

Set the aspect ratio:

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

OpenersExampleSubsection3(Spacer1)Background  (1)

Use colored backgrounds:

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

OpenersExampleSubsection4(Spacer1)BoundaryStyle  (2)

By default, region boundaries have no style:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];regionFn=Function[{x,y,vx,vy,n},4<n<6||0<n<2];

ListStreamPlot[data,DataRange->{{-3,3},{-3,3}},RegionFunction->regionFn,BoundaryStyle->None]

Apply a variety of styles to region boundaries:

data=Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}];regionFn=Function[{x,y,vx,vy,n},4<n<6||0<n<2];

Table[ListStreamPlot[data,DataRange->{{-3,3},{-3,3}},RegionFunction->regionFn,BoundaryStyle->b],{b,{Red,Thick,Directive[Red,Dashed]}}]

OpenersExampleSubsection5(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]

ListStreamPlot[data]

Specify the data range for the domain:

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

OpenersExampleSubsection6(Spacer1)EvaluationMonitor  (1)

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

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

OpenersExampleSubsection7(Spacer1)FrameLabel  (1)

Label the axes:

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

OpenersExampleSubsection8(Spacer1)Mesh  (5)

By default, no mesh lines are displayed:

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

Show the final sampling mesh:

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

Use a specific number of mesh lines:

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

Specify mesh lines:

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

Use different styles for different mesh lines:

ListStreamPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],Mesh->{{{2,Thick},{4,Brown},{5,{Thick,Red,Dashed}}}}]

OpenersExampleSubsection9(Spacer1)MeshFunctions  (3)

By default, mesh lines correspond to the magnitude of the field:

ListStreamPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],MeshFunctions->Function[{x,y,vx,vy,n},n],Mesh->5]

Use the x value as the mesh function:

ListStreamPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],MeshFunctions->Function[{x,y,vx,vy,n},x],Mesh->5]

Use mesh lines corresponding to fixed distances from the origin:

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

ListStreamPlot[data,DataRange->{{-3,3},{-3,3}},MeshFunctions->Function[{x,y,vx,vy,n},Sqrt[x^2+y^2]],Mesh->5]

OpenersExampleSubsection10(Spacer1)MeshShading  (3)

Use (RefLink[None, paclet:ref/None]) to remove regions:

ListStreamPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],Mesh->10,MeshShading->{Red,None}]

Styles are used cyclically:

ListStreamPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],Mesh->10,MeshShading->{Red,Yellow,Green,None}]

Use indexed colors from (RefLink[ColorData, paclet:ref/ColorData]) cyclically:

ListStreamPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],Mesh->10,MeshShading->ColorData[51,"ColorList"]]

OpenersExampleSubsection11(Spacer1)MeshStyle  (1)

Apply a variety of styles to the mesh lines:

Table[ListStreamPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],Mesh->10,MeshStyle->s],{s,{Red,Thick,Directive[Red,Dashed]}}]

OpenersExampleSubsection12(Spacer1)PerformanceGoal  (2)

Generate a higher-quality plot:

ListStreamPlot[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:

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

OpenersExampleSubsection13(Spacer1)PlotRange  (8)

The full plot range is used by default:

ListStreamPlot[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:

ListStreamPlot[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:

ListStreamPlot[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:

ListStreamPlot[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:

ListStreamPlot[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:

ListStreamPlot[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:

ListStreamPlot[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:

ListStreamPlot[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}}]

OpenersExampleSubsection14(Spacer1)PlotTheme  (1)

Use a theme with high-contrast colors and simple ticks:

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

Change the stream style:

ListStreamPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],PlotTheme->"Marketing",StreamStyle->Magenta]

OpenersExampleSubsection15(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}];

ListStreamPlot[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}];

ListStreamPlot[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}];

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

OpenersExampleSubsection16(Spacer1)StreamColorFunction  (5)

Color streamlines according to the norm of the vector field:

ListStreamPlot[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]):

ListStreamPlot[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:

ListStreamPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],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:

ListStreamPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],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:

ListStreamPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],StreamColorFunctionScaling->False,StreamPoints->Coarse,StreamColorFunction->Function[{x,y,vx,vy,n},ColorData[22][Round[n]]]]

OpenersExampleSubsection17(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}];

ListStreamPlot[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}];

ListStreamPlot[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}];

ListStreamPlot[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}];

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

OpenersExampleSubsection18(Spacer1)StreamMarkers  (3)

Streamlines are drawn as arrows by default:

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

ListStreamPlot[data]

Use a named appearance to draw the streamlines:

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

ListStreamPlot[data,StreamMarkers->"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}];

ListStreamPlot[{data1,data2},StreamScale->Large,StreamPoints->Coarse,StreamMarkers->{"Drop","Dart"}]

OpenersExampleSubsection19(Spacer1)StreamPoints  (6)

Specify a maximum number of streamlines:

ListStreamPlot[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:

Table[ListStreamPlot[Table[{-1-x^2+y,1+x-y^2},{x,-3,3,0.2},{y,-3,3,0.2}],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}];

ListStreamPlot[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[ListStreamPlot[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[ListStreamPlot[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[ListStreamPlot[data,DataRange->{{-3,3},{-3,3}},VectorStyle->Orange,StreamPoints->{points,Automatic,maxlen},Epilog->Point[points]],{maxlen,{2.5,Scaled[0.2]}}]

OpenersExampleSubsection20(Spacer1)StreamScale  (9)

Create full streamlines without segmentation:

ListStreamPlot[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:

ListStreamPlot[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:

Table[ListStreamPlot[Table[{Sin[x],Cos[y]},{x,-Pi,Pi,0.2},{y,-Pi,Pi,0.2}],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[ListStreamPlot[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:

ListStreamPlot[Table[{Sin[x],Cos[y]},{x,-Pi,Pi,0.2},{y,-Pi,Pi,0.2}],VectorPoints->8,VectorStyle->Orange,StreamPoints->Coarse,StreamScale->{{0.1,0.1},Automatic}]

Specify number of points rendered on each streamline segment:

Table[ListStreamPlot[Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}],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[ListStreamPlot[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[ListStreamPlot[data,DataRange->{{-Pi,Pi},{-Pi,Pi}},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}];

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

OpenersExampleSubsection21(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[ListStreamPlot[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}];

ListStreamPlot[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}];

ListStreamPlot[{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[ListStreamPlot[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[ListStreamPlot[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[ListStreamPlot[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[ListStreamPlot[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[ListStreamPlot[data,PlotLabel->s,StreamScale->{Full,All,0.03},StreamPoints->Coarse,StreamStyle->s],{s,{"Dart","PinDart","DoubleDart"}}]

OpenersExampleSubsection22(Spacer1)VectorColorFunction  (4)

Color the vectors according to their norms:

ListStreamPlot[Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}],StreamStyle->LightGray,VectorPoints->8,VectorColorFunction->Hue]

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

ListStreamPlot[Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}],StreamStyle->LightGray,VectorPoints->8,VectorColorFunction->"Rainbow"]

Color the vectors according to their x values:

ListStreamPlot[Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}],StreamStyle->LightGray,VectorPoints->8,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}];

ListStreamPlot[data,StreamStyle->LightGray,VectorPoints->8,VectorColorFunction->Function[{x,y,vx,vy,n},ColorData[22][Round[n]]],VectorColorFunctionScaling->False]

OpenersExampleSubsection23(Spacer1)VectorColorFunctionScaling  (4)

By default, scaled values are used:

ListStreamPlot[Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}],StreamStyle->LightGray,VectorPoints->8,VectorColorFunction->GrayLevel]

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}];

ListStreamPlot[data,StreamStyle->LightGray,VectorPoints->8,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}];

ListStreamPlot[data,StreamStyle->LightGray,VectorPoints->8,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}];

ListStreamPlot[data,StreamStyle->LightGray,VectorPoints->8,VectorColorFunction->Function[{x,y,vx,vy,n},Hue[n,y,1]], VectorColorFunctionScaling->{True,True,True,True,False}]

OpenersExampleSubsection24(Spacer1)VectorPoints  (8)

Use automatically determined vector points:

ListStreamPlot[Table[{y,-x},{x,-1,1,0.2},{y,-1,1,0.2}],StreamStyle->LightGray,VectorPoints->Automatic]

Show all of the specified field vectors:

ListStreamPlot[Table[{y,-x},{x,-1,1,0.2},{y,-1,1,0.2}],StreamStyle->LightGray,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[ListStreamPlot[data,PlotLabel->k,StreamStyle->LightGray,VectorPoints->k],{k,{Fine,Coarse}}]

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

ListStreamPlot[Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}],StreamStyle->LightGray,VectorPoints->5]

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

ListStreamPlot[Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}],StreamStyle->LightGray, 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}];

ListStreamPlot[data,DataRange->{{-3,3},{-3,3}},StreamStyle->LightGray,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[ListStreamPlot[data,StreamStyle->LightGray,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}};

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

OpenersExampleSubsection25(Spacer1)VectorScale  (9)

Use automatically determined vector scale:

ListStreamPlot[Table[{y,-x},{x,-3,3,0.2},{y,-3,3,0.2}],DataRange->{{-3,3},{-3,3}},StreamStyle->LightGray,VectorPoints->8,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[ListStreamPlot[data,StreamStyle->LightGray,VectorPoints->8,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[ListStreamPlot[data,StreamStyle->LightGray,VectorPoints->8,VectorScale->s,PlotLabel->s],{s,{Tiny,Small,Medium,Large}}]

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

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

Table[ListStreamPlot[data,StreamStyle->LightGray,VectorPoints->8,PlotLabel->ToString[f],VectorScale->{Automatic,Automatic,f}],{f,{None,Automatic}}]

Specify an absolute size for the arrowheads:

ListStreamPlot[Table[{Sin[x],Cos[y]},{x,-Pi,Pi,0.2},{y,-Pi,Pi,0.2}],StreamStyle->LightGray,VectorPoints->8,VectorScale->{Large,1}]

Specify arrowhead size relative to the length of the arrow:

ListStreamPlot[Table[{Sin[x],Cos[y]},{x,-Pi,Pi,0.2},{y,-Pi,Pi,0.2}],StreamStyle->LightGray,VectorPoints->8,VectorScale->{Large,Scaled[1]}]

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

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

ListStreamPlot[data,StreamStyle->LightGray,VectorPoints->8,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[ListStreamPlot[data,StreamStyle->LightGray,VectorPoints->8,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.4},{y,-3,3,0.4}];

ListStreamPlot[data,StreamStyle->LightGray,VectorPoints->8,VectorScale->{Automatic,Automatic,#},PlotLabel->HoldForm[#]]& /@ {None,Function[If[#5>1,None,#5]]}

OpenersExampleSubsection26(Spacer1)VectorStyle  (7)

Set the style for the displayed vectors:

ListStreamPlot[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}];

ListStreamPlot[{data1,data2},StreamPoints->Coarse,StreamStyle->{Orange,Gray},VectorPoints->8,VectorStyle->{Red,Blue}]

Plot the vector fields without arrowheads:

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

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

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

ListStreamPlot[data,StreamStyle->LightGray,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}];

ListStreamPlot[data,StreamStyle->LightGray,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}];

ListStreamPlot[data,StreamStyle->LightGray,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}];

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

OpenersExampleSection3(Spacer1)Applications  (5)

Global attractor of damped conservative system:

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

ListStreamPlot[data,StreamScale->Large]

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

image=ColorConvert[,"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}];

ListStreamPlot[data,StreamScale->0.15]

Compute wind velocity from given coordinates:

windVelocity[x_,y_]:=-QuantityMagnitude@WeatherData[{y,x},"WindSpeed"]{1/Cos[y °],1} Through[{Sin,Cos}[WeatherData[{y,x},"WindDirection"]]]

Filter unavailable data:

filter[d_]:=Cases[d,u_/;FreeQ[u,"NotAvailable"]]/. 0.->.001

Outline of Australia:

outline=Graphics[{GrayLevel[0.2],AbsoluteThickness[3.0],CountryData["Australia","Polygon"]/.Polygon->Line}]

Wind velocity over Australia:

data=Table[{{x,y},windVelocity[x,y]},{x,113,153,4},{y,-43,-11,4}]//Flatten[#,1]&//filter;

Show[ListStreamPlot[data,StreamColorFunction->"RustTones",AspectRatio->Automatic,InterpolationOrder->None,StreamPoints->{Automatic,0.5}],outline]

Organize several datasets into a tabbed view:

data={"Positive Invariant Set"->Table[{y,-x+y(1-x^2-2y^2)},{x,-3,3},{y,-3,3}],"Structurally Stable System"->Table[{2x+y-x(x^2+y^2),-y-y(x^2+y^2)},{x,-3,3},{y,-3,3}],"Duffing's Equation"->Table[{y,x-x^3},{x,-3,3},{y,-3,3}]};

fieldIcon[data_]:=Image[ListStreamPlot[data,Axes->False,Frame->False,StreamPoints->20],ImageSize->40]

TabView[Table[fieldIcon[d[[2]]]->ListStreamPlot[d[[2]],ImageSize->200,StreamScale->0.2,PlotLabel->d[[1]]],{d,data}]]

Explore various streamline styles and scales with several examples:

fields={{x+y^2+y^3,-x+y+y x^2},{x-x y^2+y^3,3y-y x^2+x^3},{(2-x-2y)x,(2-2x-y)y},{y,(1-x^2-y^2)y/20-x},{2 x y,1+x^2-y^2},{y,x-x^2+(1+x)y}};

fieldData=Table[Table[f,{x,-3,3},{y,-3,3}],{f,fields}];

styles={"Arrow","ArrowArrow","CircleArrow","BarDot","Dot","DotDot","DotArrow","Dart","Drop","BackwardPointer","Pointer","Toothpick","Dart","PinDart","DoubleDart","Segment","Line"};

Generate icons to graphically represent field choices:

icons=Table[f->Image[ListStreamPlot[f,Axes->False,Frame->False,StreamPoints->20,StreamStyle->"Line"],ImageSize->42],{f,fieldData}];

Click on the field icons to switch field plots:

Manipulate[ListStreamPlot[field,ImageSize->300,StreamStyle->style,StreamScale->scale,StreamColorFunction->color],{style,styles},{color,ColorData["Gradients"]},{{scale,0.2},0.05,0.5,0.05},{{field,icons[[1,1]]},icons,Setter}]

OpenersExampleSection4(Spacer1)Properties & Relations  (6)

Use (RefLink[StreamPlot, paclet:ref/StreamPlot]) for plotting functions:

StreamPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3}]

Use (RefLink[ListStreamDensityPlot, paclet:ref/ListStreamDensityPlot]) 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}];

ListStreamDensityPlot[data,ColorFunction->"Pastel"]

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

StreamDensityPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3}]

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

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

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[ListVectorPlot, paclet:ref/ListVectorPlot])  ▪  (RefLink[ListVectorDensityPlot, paclet:ref/ListVectorDensityPlot])  ▪  (RefLink[StreamPlot, paclet:ref/StreamPlot])  ▪  (RefLink[ListVectorPlot3D, paclet:ref/ListVectorPlot3D])  ▪  (RefLink[ListSliceVectorPlot3D, paclet:ref/ListSliceVectorPlot3D])}})}})

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

({{(Spacer1), ({{(Spacer1)Related Links}, {(WebLink[DocumentationFooterIconsRelatedLinks-EIWL.png(Spacer1)An Elementary Introduction to the Wolfram Language, https://www.wolfram.com/language/elementary-introduction/24-more-forms-of-visualization.html])(WebLink[: More Forms of Visualization, https://www.wolfram.com/language/elementary-introduction/24-more-forms-of-visualization.html])}})}})