StreamDensityPlot

StreamDensityPlot[{{vx,vy},s},{x,xmin,xmax},{y,ymin,ymax}]

generates a stream plot of the vector field {vx,vy} as a function of x and y, superimposed on a background density plot of the scalar field s.

StreamDensityPlot[{vx,vy},{x,xmin,xmax},{y,ymin,ymax}]

takes the scalar field to be the norm of the vector field.

StreamDensityPlot[{{vx,vy},{wx,wy},,s},{x,xmin,xmax},{y,ymin,ymax}]

generates plots of several vector fields.

StreamDensityPlot[,{x,y}reg]

takes the variables {x,y} to be in the geometric region reg.

Details and Options

Examples

open allclose all

Basic Examples  (3)

Plot the streamlines for a vector field with background based on field magnitude:

Plot the streamlines for a vector field with background based on a logarithm of field magnitude:

Plot the streamlines for two fields with a background based on the first field's magnitude:

Scope  (25)

Sampling  (11)

Visualize a vector field with the background based on :

Plot two vector fields with background color based on the first field's magnitude:

Use Evaluate to evaluate the vector field symbolically before numeric assignment:

Plot a vector field with streamlines placed with specified densities:

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

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

Plot streamlines over a specified region:

Use a specific number of mesh lines:

Specify mesh lines:

The domain may be specified by a region:

The domain may be specified by a MeshRegion:

Presentation  (14)

Specify different dashings and arrowheads by settings to StreamScale:

Color the background scalar field with a color function:

Plot the streamlines with arrows colored according to field magnitude:

Apply a variety of streamline styles:

Use different themes for the plot:

Use a named appearance to draw the streamlines:

Style the streamlines as well:

Plot vectors and streamlines together:

Specify mesh lines with different styles:

Specify global mesh line styles:

Shade mesh regions cyclically:

Apply a variety of styles to region boundaries:

Fix the lighting angle at 0 (right of the plot), and vary the altitude from 0 to π/2:

Include a legend for the streamlines:

Include a legend for the scalar field:

Options  (86)

AspectRatio  (2)

By default, the aspect ratio is 1:

Set the aspect ratio:

Background  (1)

Use colored backgrounds:

BoundaryStyle  (2)

By default, region boundaries have no style:

Apply a variety of styles to region boundaries:

ColorFunction  (6)

Color the field magnitude using Hue:

Color using Hue based on :

Use any named color gradient from ColorData:

Use ColorData for predefined color gradients:

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

Use ColorFunctionScaling->False to get unscaled values:

ColorFunctionScaling  (4)

By default, scaled values are used:

Use ColorFunctionScaling->False to get unscaled values:

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

Explicitly specify the scaling for each color function argument:

EvaluationMonitor  (2)

Show where the vector field function is sampled:

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

FrameLabel  (1)

Label the axes:

LightingAngle  (2)

Vary the lighting angle from 0 (right of the plot) to π/2 (top of the plot):

Fix the lighting angle at 0 (right of the plot), and vary the altitude from 0 to π/2:

MaxRecursion  (1)

Refine the plot where it changes quickly:

Mesh  (5)

By default, no mesh lines are displayed:

Show the final sampling mesh:

Use a specific number of mesh lines:

Specify mesh lines:

Use different styles for different mesh lines:

MeshFunctions  (3)

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

Use the value as the mesh function:

Use mesh lines corresponding to fixed distances from the origin:

MeshShading  (3)

Use None to remove regions:

Styles are used cyclically:

Use indexed colors from ColorData cyclically:

MeshStyle  (1)

Apply a variety of styles to the mesh lines:

NormalsFunction  (2)

Do not use normals in shading:

Randomly vary the effective normals:

PerformanceGoal  (2)

Generate a higher-quality plot:

Emphasize performance, possibly at the cost of quality:

PlotLegends  (3)

No legends are included, by default:

Include a legend for the streamlines:

Include a legend for the scalar field:

Control the placement of the legend:

PlotRange  (7)

The full plot range is used by default:

Specify an explicit limit for both and ranges:

Specify an explicit range:

Specify an explicit minimum range:

Specify an explicit range:

Specify an explicit maximum range:

Specify different and ranges:

PlotTheme  (2)

Use a monochrome theme:

Change the stream style:

RegionFunction  (3)

Plot streamlines only over certain quadrants:

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

Use any logical combination of conditions:

StreamColorFunction  (5)

Color streamlines according to the norm of the vector field:

Use any named color gradient from ColorData:

Use ColorData for predefined color gradients:

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

Use StreamColorFunctionScaling->False to get unscaled values:

StreamColorFunctionScaling  (4)

By default, scaled values are used:

Use StreamColorFunctionScaling->False to get unscaled values:

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

Explicitly specify the scaling for each color function argument:

StreamMarkers  (3)

Streamlines are drawn as arrows by default:

Use a named appearance to draw the streamlines:

Use different markers for different vector fields:

StreamPoints  (6)

Specify a maximum number of streamlines:

Use symbolic names to specify the number of streamlines:

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

Specify the minimum distance between streamlines:

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

Control the maximum length that each streamline can have:

StreamScale  (9)

Create full streamlines without segmentation:

Use curves for streamlines:

Use symbolic names to control the lengths of streamlines:

Specify segment lengths:

Specify an explicit dashing pattern for streamlines:

Specify the number of points rendered on each streamline segment:

Specify absolute aspect ratios relative to the longest line segment:

Specify relative aspect ratios relative to each line segment:

Scale the length of the arrows by the coordinate:

StreamStyle  (7)

Apply a variety of styles to the streamlines:

Specify a custom arrowhead:

Set the style for multiple vector fields:

Named arrow styles:

Named dot styles:

Named pointer styles:

Named dart styles:

Applications  (16)

Visualize a vector field with the background based on the field's divergence:

Visualize a vector field with the background based on the magnitude of the field's curl:

Show streamlines superimposed on the Hamiltonian for a 2D Hamiltonian system:

Check how closely NDSolve conserves the invariant:

Characterize linear planar systems interactively:

Use a stream plot as a background for an interactive differential equation demo:

Combine several examples into a tabbed view:

Mouse over the tabs to get a description of the field:

Quadratic system with two limit cycles:

Homoclinic loops:

Unfolding a double zero eigenvalue with odd symmetry:

Explore a parameterized vector field using Manipulate:

Vibrating membranes:

Unfolding a function and its gradient field:

Generate a list of rasterized plots for animation:

Animating a list of rasters instead of the original vector graphics may reduce memory usage:

Create an animation that shifts the streamline colors in the direction of the vector norms:

Explore various streamline styles and scales with several examples:

Generate icons to graphically represent field choices:

Click the field icons to switch field plots:

Generate a list of stream plots of varying :

Stack 2D stream plots in 3D:

Properties & Relations  (11)

Use ListStreamDensityPlot for plotting data:

Use StreamPlot for plotting only streamlines without a plot of the scalar field:

Use VectorDensityPlot to plot functions with vectors instead of streamlines:

Use ListVectorDensityPlot to plot data with vectors instead of streamlines:

Use VectorPlot to plot with vectors instead of streamlines without a plot of the scalar field:

Use VectorPlot3D to visualize 3D vector fields:

Use SliceVectorPlot3D to visualize 3D vector fields along a surface:

StreamDensityPlot samples more points where it needs to:

Scalar fields can be plotted by themselves with DensityPlot:

Use LineIntegralConvolutionPlot to plot the line integral convolution of a vector field:

Plot complex numbers as a vector field:

Neat Examples  (3)

Plot streamlines with the divergence as the background density:

Plot streamlines with the absolute value of the vorticity as the background density:

Constrain the stream plot to a variety of regions:

Introduced in 2008
 (7.0)
 |
Updated in 2012
 (9.0)
2014
 (10.0)
2018
 (11.3)