ListStreamDensityPlot[varr]
generates a stream density plot from an array varr of vector and scalar field values {{vxij,vyij},rij}.
ListStreamDensityPlot[{{{x1,y1},{{vx1,vy1},r1}},…}]
generates a stream density plot from vector and scalar field values {{vxi,vyi},ri} given at specified points {xi,yi}.
ListStreamDensityPlot[{data1,data2,…}]
plots data for several vector and scalar fields.
ListStreamDensityPlot
ListStreamDensityPlot[varr]
generates a stream density plot from an array varr of vector and scalar field values {{vxij,vyij},rij}.
ListStreamDensityPlot[{{{x1,y1},{{vx1,vy1},r1}},…}]
generates a stream density plot from vector and scalar field values {{vxi,vyi},ri} given at specified points {xi,yi}.
ListStreamDensityPlot[{data1,data2,…}]
plots data for several vector and scalar fields.
Details and Options
- ListStreamDensityPlot generates a stream plot of the vector field, superimposed on a background density plot of the scalar field.
- ListStreamDensityPlot plots streamlines
defined by
and
where
is an interpolated function of the vector data and
is an initial stream point. The streamline
is the curve passing through point
, and whose tangents correspond to the vector field
at each point. - The streamlines are drawn over a density plot of the scalar field
, whose default value is the magnitude
of the vector field. - The streamlines are colored by default according to the magnitude
of the vector field
and have an arrow in the direction of increasing value of
. - ListStreamDensityPlot interpolates the data into vector function
and scalar function
. - For regular data, the vector field
has value varr〚i,j,1〛 and the scalar field has value varr〚i,j,2〛 at
. - For irregular data, the vector field
has value {vxi,vyi} and the scalar field has value riat
. - If no scalar field values are given, they are taken to be the norm of the vector field.
- ListStreamDensityPlot plots streamlines that show the local direction of the vector field at every point.
- ListStreamDensityPlot[varr] arranges successive rows of array up the page and successive columns across.
- ListStreamDensityPlot by default interpolates the data given and shows enough streamlines to achieve a roughly uniform density throughout the plot.
- ListStreamDensityPlot has the same options as Graphics, with the following additions and changes: [List of all options]
-
AspectRatio 1 ratio of height to width BoundaryStyle None how to draw RegionFunction boundaries BoxRatios Automatic effective 3D box ratios for simulated lighting ColorFunction Automatic how to color background densities ColorFunctionScaling True whether to scale arguments to ColorFunction DataRange Automatic the range of x and y values to assume for data EvaluationMonitor None expression to evaluate at every function evaluation Frame True whether to draw a frame around the plot FrameTicks Automatic frame tick marks LightingAngle None effective angle for simulated lighting MaxRecursion Automatic the maximum number of recursive subdivisions allowed for the scalar field Mesh None how many mesh lines to draw in the background MeshFunctions {#5&} how to determine the placement of mesh lines MeshShading None how to shade regions between mesh lines MeshStyle Automatic the style of mesh lines Method Automatic methods to use for the plot PerformanceGoal $PerformanceGoal aspects of performance to try to optimize PlotLegends None legends to use for the plot 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 RegionFunction True& determine what region to include ScalingFunctions None how to scale individual coordinates StreamColorFunction Automatic how to color streamlines StreamColorFunctionScaling True whether to scale the argument to StreamColorFunction StreamMarkers Automatic shape to use for streams StreamPoints Automatic determine number, placement, and closeness of streamlines StreamScale Automatic determine sizes and segmenting of individual streamlines StreamStyle Automatic how to draw streamlines WorkingPrecision MachinePrecision precision to use in internal computations - The arguments supplied to functions in MeshFunctions, RegionFunction, ColorFunction, and StreamColorFunction are x, y, vx, vy, r.
- The default setting MeshFunctions->{#5&} draws mesh lines for the scalar field r.
- 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 BoundaryStyle None how to draw RegionFunction boundaries BoxRatios Automatic effective 3D box ratios for simulated lighting ColorFunction Automatic how to color background densities ColorFunctionScaling True whether to scale arguments to ColorFunction ContentSelectable Automatic whether to allow contents to be selected CoordinatesToolOptions Automatic detailed behavior of the coordinates tool DataRange Automatic the range of x and y values to assume for data 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 LightingAngle None effective angle for simulated lighting MaxRecursion Automatic the maximum number of recursive subdivisions allowed for the scalar field Mesh None how many mesh lines to draw in the background MeshFunctions {#5&} how to determine the placement of mesh lines MeshShading None how to shade regions between mesh lines MeshStyle Automatic the style of mesh lines 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 PlotLegends None legends to use for the plot 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 RegionFunction True& determine what region to include RotateLabel True whether to rotate y labels on the frame ScalingFunctions None how to scale individual coordinates StreamColorFunction Automatic how to color streamlines StreamColorFunctionScaling True whether to scale the argument to StreamColorFunction StreamMarkers Automatic shape to use for streams StreamPoints Automatic determine number, placement, and closeness of streamlines StreamScale Automatic determine sizes and segmenting of individual streamlines StreamStyle Automatic how to draw streamlines Ticks Automatic axes ticks TicksStyle {} style specifications for axes ticks WorkingPrecision MachinePrecision precision to use in internal computations
List of all options
Examples
open all close allBasic Examples (2)
Plot streamlines and background 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}];ListStreamDensityPlot[data]Plot the streamlines and background 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}];ListStreamDensityPlot[data]Scope (24)
Sampling (11)
Plot streamlines for a regular collection of vectors and give a data range for the domain:
ListStreamDensityPlot[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:
ListStreamDensityPlot[Table[{{x, y} = RandomReal[{-3, 3}, 2], {-1 - x ^ 2 + y, 1 + x - y ^ 2}}, {200}]]Use an explicit scalar field on a regular collection of vectors:
f = {y, x - x ^ 3};
s = Abs[x + y];
data = Table[{f, s}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];ListStreamDensityPlot[data]Use an explicit scalar field on an irregular collection of vectors:
data = Table[{{x, y} = RandomReal[{-1.5, 1.5}, {2}], {{y, x - x ^ 3}, Abs[x + y]}}, {300}];ListStreamDensityPlot[data]Plot streamlines for two vector fields with the background based on the norm of the first:
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}];ListStreamDensityPlot[{data1, data2}, StreamColorFunction -> None]Plot a vector field with streamlines placed with specified densities:
data = Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, .2}, {y, -3, 3, .2}];Table[ListStreamDensityPlot[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, .2}, {y, -3, 3, .2}];ListStreamDensityPlot[data, DataRange -> {{-3, 3}, {-3, 3}}, StreamPoints -> Tuples[{-2, 0, 2}, 2], Epilog -> Point[Tuples[{-2, 0, 2}, 2]]]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, .2}, {y, -3, 3, .2}];ListStreamDensityPlot[data, DataRange -> {{-3, 3}, {-3, 3}}, StreamPoints -> {{{{1, 0}, Red}, {{-1, -1}, Green}, Automatic}}, StreamColorFunction -> None]Plot streamlines over a specified region:
data = Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, .2}, {y, -3, 3, .2}];ListStreamDensityPlot[data, DataRange -> {{-3, 3}, {-3, 3}}, RegionFunction -> Function[{x, y, vx, vy, n}, x y < 0]]Use a specific number of mesh lines:
ListStreamDensityPlot[Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, .2}, {y, -3, 3, .2}], Mesh -> 5]ListStreamDensityPlot[Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, .2}, {y, -3, 3, .2}], Mesh -> {{2, 4, 5}}]Presentation (13)
Give a data range for the domain:
ListStreamDensityPlot[Table[{y, -x}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}], DataRange -> {{-3, 3}, {-3, 3}}]Use a different set of colors for the scalar field:
ListStreamDensityPlot[Table[{y, -x}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}], ColorFunction -> "Pastel"]Specify different dashings and arrowheads by setting to StreamScale:
data = Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];Table[ListStreamDensityPlot[data, PlotLabel -> ToString@s, StreamScale -> s], {s, {Automatic, None, Full}}]Plot the streamlines with arrows colored according to the magnitude of the field:
ListStreamDensityPlot[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 markers:
data = Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];Table[ListStreamDensityPlot[data, StreamScale -> Full, StreamMarkers -> s], {s, {"Toothpick", "Dart", "Segment"}}]Use a theme with simpler ticks and brighter colors:
data = Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];ListStreamDensityPlot[data, PlotTheme -> "Web"]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}];ListStreamDensityPlot[data, StreamMarkers -> "Drop"]Style the streamlines as well:
ListStreamDensityPlot[data, StreamMarkers -> "Drop", StreamStyle -> Blue, StreamColorFunction -> None]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}];ListStreamDensityPlot[{data1, data2}, StreamMarkers -> {"Drop", "Dart"}, StreamStyle -> {Blue, Black}, StreamColorFunction -> None]Specify mesh lines with different styles:
ListStreamDensityPlot[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[ListStreamDensityPlot[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:
ListStreamDensityPlot[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[ListStreamDensityPlot[data, RegionFunction -> regionFn, BoundaryStyle -> b], {b, {Red, Thick, Directive[Red, Dashed]}}]Reverse the direction of the y axis:
ListStreamDensityPlot[Flatten[Table[{{x, y}, {x, y - x}}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}], 1], ScalingFunctions -> {None, "Reverse"}]Options (80)
Background (1)
ColorFunction (6)
Color the field magnitude using Hue:
ListStreamDensityPlot[Table[{y, -x}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}], MaxRecursion -> 2, ColorFunction -> Hue]Color using Hue based on
:
ListStreamDensityPlot[Table[{{y, -x}, Sin[x y]}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}], DataRange -> {{-3, 3}, {-3, 3}}, MaxRecursion -> 3, ColorFunction -> Hue]Use any named color gradient from ColorData:
ListStreamDensityPlot[Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}], ColorFunction -> "Pastel"]Use 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}];ListStreamDensityPlot[data, ColorFunction -> Function[{x, y, vx, vy, n}, ColorData["SolarColors"][x y]]]Specify a color function that blends two colors by the
coordinate:
data = Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];ListStreamDensityPlot[data, ColorFunction -> Function[{x, y, vx, vy, n}, Blend[{Green, Red}, x]]]Use ColorFunctionScaling->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}];ListStreamDensityPlot[data, MaxRecursion -> 4, ColorFunctionScaling -> False, ColorFunction -> Function[{x, y, vx, vy, n}, ColorData[22][Round[n]]]]ColorFunctionScaling (4)
By default, scaled values are used:
data = Table[{y Cos[x y], x Cos[x y]}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];ListStreamDensityPlot[data, MaxRecursion -> 2, ColorFunction -> GrayLevel]Use ColorFunctionScaling->False to get unscaled values:
data = Table[{y Cos[x y], x Cos[x y]}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];ListStreamDensityPlot[data, MaxRecursion -> 4, ColorFunctionScaling -> False, ColorFunction -> Function[{x, y, vx, vy, n}, ColorData[22][Round[n]]]]Use unscaled coordinates in the
direction and scaled coordinates in the
direction:
data = Table[{y Cos[x y], x Cos[x y]}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];ListStreamDensityPlot[data, ColorFunctionScaling -> {False, True}, ColorFunction -> Function[{x, y, vx, vy, n}, Hue[x, y, 1]]]Explicitly specify the scaling for each color function argument:
data = Table[{y Cos[x y], x Cos[x y]}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];ListStreamDensityPlot[data, MaxRecursion -> 3, ColorFunctionScaling -> {True, True, True, True, False}, ColorFunction -> Function[{x, y, vx, vy, n}, Hue[n, y, 1]]]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]ListStreamDensityPlot[data]Specify the data range for the domain:
ListStreamDensityPlot[data, DataRange -> {{-3, 3}, {-3, 3}}]EvaluationMonitor (1)
MaxRecursion (1)
Mesh (5)
By default, no mesh lines are displayed:
ListStreamDensityPlot[Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}], Mesh -> None]ListStreamDensityPlot[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:
ListStreamDensityPlot[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]ListStreamDensityPlot[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:
ListStreamDensityPlot[Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}], Mesh -> {{{2, Thick}, {4, Yellow}, {5, {Thick, Red, Dashed}}}}]MeshFunctions (3)
By default, mesh lines correspond to the magnitude of the field:
ListStreamDensityPlot[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
value as the mesh function:
ListStreamDensityPlot[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}];ListStreamDensityPlot[data, DataRange -> {{-3, 3}, {-3, 3}}, MeshFunctions -> Function[{x, y, vx, vy, n}, Sqrt[x ^ 2 + y ^ 2]], Mesh -> 5]MeshShading (3)
Use None to remove regions:
ListStreamDensityPlot[Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}], Mesh -> 10, MeshShading -> {Red, None}]ListStreamDensityPlot[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 ColorData cyclically:
ListStreamDensityPlot[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"]]MeshStyle (1)
PerformanceGoal (2)
Generate a higher-quality plot:
ListStreamDensityPlot[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:
ListStreamDensityPlot[Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}], PerformanceGoal -> "Speed"]PlotLegends (1)
Include a legend for the scalar field:
data = Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, .2}, {y, -3, 3, .2}];ListStreamDensityPlot[data, PlotLegends -> Automatic]Place the legend below the plot:
ListStreamDensityPlot[data, PlotLegends -> Placed[Automatic, Below]]PlotRange (5)
The full plot range is used by default:
ListStreamDensityPlot[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
and
ranges:
ListStreamDensityPlot[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]ListStreamDensityPlot[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, 2}, Automatic}]ListStreamDensityPlot[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 -> {Automatic, {0, 2}}]ListStreamDensityPlot[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}}]PlotTheme (1)
Plot a vector field using monochrome colors:
data = Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, .2}, {y, -3, 3, .2}];ListStreamDensityPlot[data, PlotTheme -> "Monochrome"]Use white streamlines instead of black:
ListStreamDensityPlot[data, PlotTheme -> "Monochrome", StreamStyle -> White]RegionBoundaryStyle (2)
Show the region being plotted:
data = Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];ListStreamDensityPlot[data, DataRange -> {{-3, 3}, {-3, 3}}, RegionFunction -> Function[{x, y, vx, vy, n}, x^2 + y^2 ≤ 9]]data = Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];ListStreamDensityPlot[data, DataRange -> {{-3, 3}, {-3, 3}}, RegionFunction -> Function[{x, y, vx, vy, n}, x^2 + y^2 ≤ 9], RegionBoundaryStyle -> Directive[Thick, StandardGreen]]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}];ListStreamDensityPlot[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}];ListStreamDensityPlot[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}];ListStreamDensityPlot[data, DataRange -> {{-3, 3}, {-3, 3}}, RegionFunction -> Function[{x, y, vx, vy, n}, 4 < n < 9 || 0 < n < 2]]ScalingFunctions (3)
By default, linear scales are used:
ListStreamDensityPlot[Table[{y, x - y}, {x, -1, 1, 0.1}, {y, -1, 1, 0.1}]]Use a log scale in the y direction:
ListStreamDensityPlot[Table[{y, x - y}, {x, -1, 1, 0.1}, {y, -1, 1, 0.1}], ScalingFunctions -> {None, "Log"}]Reverse the direction of the y direction:
ListStreamDensityPlot[Table[{y, x - y}, {x, -1, 1, 0.1}, {y, -1, 1, 0.1}], ScalingFunctions -> {None, "Reverse"}]StreamColorFunction (5)
Color streamlines according to the norm of the vector field:
ListStreamDensityPlot[Table[{Sin[x], Cos[y]}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}], StreamColorFunction -> Hue]Use any named color gradient from ColorData:
ListStreamDensityPlot[Table[{Sin[x], Cos[y]}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}], StreamColorFunction -> "ValentineTones"]Use ColorData for predefined color gradients:
ListStreamDensityPlot[Table[{Sin[x], Cos[y]}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}], StreamColorFunction -> Function[{x, y, vx, vy, n}, ColorData["SolarColors"][x y]]]Specify a color function that blends two colors by the
coordinate:
ListStreamDensityPlot[Table[{Sin[x], Cos[y]}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}], StreamColorFunction -> Function[{x, y, vx, vy, n}, Blend[{Green, Red}, x]]]Use StreamColorFunctionScaling->False to get unscaled values:
ListStreamDensityPlot[Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}], StreamColorFunctionScaling -> False, StreamColorFunction -> Function[{x, y, vx, vy, n}, ColorData[22][Round[n]]]]StreamColorFunctionScaling (4)
By default, scaled values are used:
data = Table[{Sin[x], Cos[y]}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];ListStreamDensityPlot[data, StreamPoints -> Fine, StreamColorFunction -> GrayLevel]Use StreamColorFunctionScaling->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}];ListStreamDensityPlot[data, StreamPoints -> Fine, StreamColorFunctionScaling -> False, StreamColorFunction -> Function[{x, y, vx, vy, n}, ColorData[22][Round[n]]]]Use unscaled coordinates in the
direction and scaled coordinates in the
direction:
data = Table[{Sin[x], Cos[y]}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];ListStreamDensityPlot[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[{Sin[x], Cos[y]}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];ListStreamDensityPlot[data, StreamColorFunction -> Function[{x, y, vx, vy, n}, Hue[n, y, 1]], StreamColorFunctionScaling -> {True, True, True, True, False}]StreamMarkers (8)
Streamlines are drawn as arrows by default:
data = Table[{y, -x}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];ListStreamDensityPlot[data]Use a named appearance to draw the streamlines:
data = Table[{y, -x}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];ListStreamDensityPlot[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}];ListStreamDensityPlot[{data1, data2}, StreamScale -> Large, StreamPoints -> Coarse, StreamMarkers -> {"Drop", "Dart"}]data = Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];Table[ListStreamDensityPlot[data, PlotLabel -> s, StreamScale -> {Full, All, 0.05}, StreamMarkers -> s], {s, {"Segment", "Line"}}]data = Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];Table[ListStreamDensityPlot[data, PlotLabel -> s, StreamScale -> {Full, All, 0.05}, StreamMarkers -> s], {s, {"Arrow", "ArrowArrow", "CircleArrow"}}]data = Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];Table[ListStreamDensityPlot[data, PlotLabel -> s, StreamScale -> {Full, All, 0.03}, StreamMarkers -> s], {s, {"BarDot", "Dot", "DotArrow", "DotDot"}}]data = Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];Table[ListStreamDensityPlot[data, PlotLabel -> s, StreamScale -> {Full, All, 0.03}, StreamMarkers -> s], {s, {"Drop", "BackwardPointer", "Pointer", "Toothpick"}}]data = Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];Table[ListStreamDensityPlot[data, PlotLabel -> s, StreamScale -> {Full, All, 0.03}, StreamMarkers -> s], {s, {"Dart", "PinDart", "DoubleDart"}}]StreamPoints (6)
Specify a maximum number of streamlines:
ListStreamDensityPlot[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[ListStreamDensityPlot[Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}], 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}];ListStreamDensityPlot[data, DataRange -> {{-3, 3}, {-3, 3}}, StreamStyle -> Gray, StreamPoints -> {{{{1, 0}, Red}, {{-1, -1}, Green}, Automatic}}, StreamColorFunction -> None]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[ListStreamDensityPlot[data, PlotLabel -> d, 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[ListStreamDensityPlot[data, PlotLabel -> d, 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[{-2, 0, 2}, 2]Table[ListStreamDensityPlot[data, DataRange -> {{-3, 3}, {-3, 3}}, StreamStyle -> Red, StreamColorFunction -> None, StreamPoints -> {points, Automatic, maxlen}, Epilog -> Point[points]], {maxlen, {2.5, Scaled[0.2]}}]StreamScale (9)
Create full streamlines without segmentation:
ListStreamDensityPlot[Table[{Sin[x], Cos[y]}, {x, -Pi, Pi, 0.2}, {y, -Pi, Pi, 0.2}], StreamPoints -> 10, StreamScale -> Full]ListStreamDensityPlot[Table[{Sin[x], Cos[y]}, {x, -Pi, Pi, 0.2}, {y, -Pi, Pi, 0.2}], StreamPoints -> 10, StreamScale -> None]Use symbolic names to control the lengths of streamlines:
Table[ListStreamDensityPlot[Table[{Sin[x], Cos[y]}, {x, -Pi, Pi, 0.2}, {y, -Pi, Pi, 0.2}], PlotLabel -> s, StreamScale -> s], {s, {Tiny, Large}}]data = Table[{Sin[x], Cos[y]}, {x, -Pi, Pi, 0.2}, {y, -Pi, Pi, 0.2}];Table[ListStreamDensityPlot[data, PlotLabel -> s, StreamScale -> s], {s, {0.1, 0.2, 0.4}}]Specify an explicit dashing pattern for streamlines:
ListStreamDensityPlot[Table[{Sin[x], Cos[y]}, {x, -Pi, Pi, 0.2}, {y, -Pi, Pi, 0.2}], 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[ListStreamDensityPlot[data, PlotLabel -> n, StreamScale -> {Full, n}], {n, {12, 24, 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[ListStreamDensityPlot[data, PlotLabel -> a, StreamPoints -> 10, 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[ListStreamDensityPlot[data, DataRange -> {{-Pi, Pi}, {-Pi, Pi}}, PlotLabel -> a, StreamPoints -> 10, StreamScale -> {Automatic, Automatic, a}], {a, {Scaled[0.5], Scaled[1], Scaled[1.5]}}]Scale the length of the arrows by the
coordinate:
data = Table[{Sin[x], Cos[y]}, {x, -Pi, Pi, 0.2}, {y, -Pi, Pi, 0.2}];ListStreamDensityPlot[data, DataRange -> {{-Pi, Pi}, {-Pi, Pi}}, StreamScale -> {Automatic, 2, Automatic, Function[{x, y, vx, vy, n}, y]}]StreamStyle (5)
StreamColorFunction has precedence over colors in StreamStyle:
data = Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];ListStreamDensityPlot[data, StreamStyle -> Black]Set StreamColorFunctionNone to specify colors with StreamStyle:
data = Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];ListStreamDensityPlot[data, StreamStyle -> Black, StreamColorFunction -> None]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[ListStreamDensityPlot[data, StreamScale -> Full, StreamStyle -> s, StreamColorFunction -> None], {s, {Red, Thick, Directive[Black, Dashed]}}]data = Table[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];ListStreamDensityPlot[data, 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}];ListStreamDensityPlot[{data1, data2}, StreamPoints -> 30, StreamStyle -> {Blue, Red}, StreamColorFunction -> None]Applications (3)
Characterize linear planar systems interactively:
Manipulate[Row[{Text["m"] == MatrixForm[m], ListStreamDensityPlot[Table[Evaluate[m.{x, y}], {x, -1, 1}, {y, -1, 1}], StreamScale -> Large, StreamColorFunction -> "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"}}]Visualize the first horizontal and vertical Gaussian derivatives of an image:
image = ColorConvert[[image], "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}];ListStreamDensityPlot[data, StreamScale -> 0.15, ColorFunction -> "SunsetColors", StreamStyle -> Gray, StreamColorFunction -> None]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[d_] := Cases[d, u_ /; FreeQ[u, "NotAvailable"]] /. 0. -> .001outline = Graphics[{GrayLevel[0.2], AbsoluteThickness[3.0], CountryData["UnitedStates", "Polygon"] /. Polygon -> Line}]Wind velocity and pressure over the United States:
pressureData = Table[{{x, y}, {windVelocity[x, y], QuantityMagnitude[ WeatherData[{y, x}, "Pressure"]]}}, {x, -126, -66, 3}, {y, 24, 51, 3}]//Flatten[#, 1]&//filter;Show[ListStreamDensityPlot[pressureData, ColorFunction -> "IslandColors", AspectRatio -> Automatic, Mesh -> 20, StreamScale -> Large, MaxRecursion -> 1], outline]Properties & Relations (12)
Use 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 ListStreamPlot for plotting data without a density plot:
data = Table[{{x, y} = RandomReal[{-1.5, 1.5}, {2}], {{-1 - x ^ 2 + y, 1 + x - y ^ 2}, Abs[x + y]}}, {300}];ListStreamPlot[data]Use ListVectorPlot to plot vectors instead of streamlines:
ListVectorPlot[data]Use ListVectorDensityPlot to plot with vectors instead of streamlines:
data = Table[{{x, y} = RandomReal[{-1.5, 1.5}, {2}], {{y, x - x ^ 3}, Abs[x] + Abs[y]}}, {300}];ListVectorDensityPlot[data]Use StreamPlot or VectorPlot for plotting functions without a density plot of the scalar field:
{StreamPlot[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3}, {y, -3, 3}],
VectorPlot[{-1 - x ^ 2 + y, 1 + x - y ^ 2}, {x, -3, 3}, {y, -3, 3}]}Use ListVectorDisplacementPlot to visualize the deformation of a region associated with a displacement vector field:
data = Table[{{x, y} = RandomReal[{-1, 1}, {2}], {y, x - x ^ 3}}, {300}];ListVectorDisplacementPlot[data, Disk[], VectorPoints -> Automatic]Use ListVectorDisplacementPlot3D to visualize the deformation of a 3D region associated with a displacement vector field:
data = Table[{{x, y, z} = RandomReal[{0, 1}, {3}], {y, x, -z}}, {300}];ListVectorDisplacementPlot3D[data, Cuboid[], VectorPoints -> "Boundary"]Use ListVectorPlot3D and ListStreamPlot3D to visualize 3D vector field data:
data = Table[{z, -x, y}, {x, -1, 1, .1}, {y, -1, 1, .1}, {z, -1, 1, .1}];{ListVectorPlot3D[data], ListStreamPlot3D[data]}Use ListSliceVectorPlot3D to visualize 3D vector field data along a surface:
ListSliceVectorPlot3D[Table[{x, y, z}, {x, -1, 1, .1}, {y, -1, 1, .1}, {z, -1, 1, .1}]]ListStreamDensityPlot samples more points where it needs to:
data = Table[{y, -x ^ 2}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];ListStreamDensityPlot[data, Mesh -> All]Scalar fields can be plotted by themselves with ListDensityPlot:
f = {-1 - x ^ 2 + y, 1 + x - y ^ 2};
s = Exp[Norm[f] / 10];data = Table[{f, s}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];
scalarData = Table[s, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}];{ListDensityPlot[scalarData, ColorFunction -> "Pastel"],
ListStreamDensityPlot[data, ColorFunction -> "Pastel"]}Use 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 GeoVectorPlot to plot vectors on a map:
GeoVectorPlot[GeoVector[GeoPosition[{{-54.79801473961214, -111.85053058521567},
{-65.56940402358214, 162.89657500795147}, {-81.67990688759895, -93.36222177594851},
{7.785750774919734, 95.44840765141487}, {-6.86571958448036, -40.946398330539864},
{ ... 904, "AngularDegrees"]},
{0.9366099079317551, Quantity[357.70482317743733, "AngularDegrees"]},
{0.8256817194791912, Quantity[242.07227508889662, "AngularDegrees"]},
{0.2661401145642981, Quantity[152.90003252279325, "AngularDegrees"]}}]]Use GeoStreamPlot to plot streamlines instead of vectors:
GeoStreamPlot[GeoVector[GeoPosition[{{-54.79801473961214, -111.85053058521567},
{-65.56940402358214, 162.89657500795147}, {-81.67990688759895, -93.36222177594851},
{7.785750774919734, 95.44840765141487}, {-6.86571958448036, -40.946398330539864},
{ ... 904, "AngularDegrees"]},
{0.9366099079317551, Quantity[357.70482317743733, "AngularDegrees"]},
{0.8256817194791912, Quantity[242.07227508889662, "AngularDegrees"]},
{0.2661401145642981, Quantity[152.90003252279325, "AngularDegrees"]}}]]Related Guides
History
Introduced in 2008 (7.0) | Updated in 2012 (9.0) ▪ 2014 (10.0) ▪ 2018 (11.3) ▪ 2020 (12.2) ▪ 2022 (13.1)
Text
Wolfram Research (2008), ListStreamDensityPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/ListStreamDensityPlot.html (updated 2022).
CMS
Wolfram Language. 2008. "ListStreamDensityPlot." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/ListStreamDensityPlot.html.
APA
Wolfram Language. (2008). ListStreamDensityPlot. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ListStreamDensityPlot.html
BibTeX
@misc{reference.wolfram_2026_liststreamdensityplot, author="Wolfram Research", title="{ListStreamDensityPlot}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/ListStreamDensityPlot.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_liststreamdensityplot, organization={Wolfram Research}, title={ListStreamDensityPlot}, year={2022}, url={https://reference.wolfram.com/language/ref/ListStreamDensityPlot.html}, note=[Accessed: 13-June-2026]}