StreamPlot
StreamPlot[{vx,vy},{x,xmin,xmax},{y,ymin,ymax}]
generates a stream plot of the vector field {vx,vy} as a function of x and y.
StreamPlot[{{vx,vy},{wx,wy},…},{x,xmin,xmax},{y,ymin,ymax}]
generates plots of several vector fields.
StreamPlot[…,{x,y}∈reg]
takes the variables {x,y} to be in the geometric region reg.
Details and Options
- StreamPlot is known as a streamline plot.
- StreamPlot plots streamlines defined by and , where 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 colored by default according to the magnitude of the vector field and have an arrow in the direction of increasing value of .
- StreamPlot by default shows enough streamlines to achieve a roughly uniform density throughout the plot, and shows no background scalar field.
- StreamPlot does not show streamlines at any positions for which the vi etc. do not evaluate to real numbers.
- StreamPlot treats the variables x and y as local, effectively using Block.
- StreamPlot has attribute HoldAll, and evaluates the vi etc. only after assigning specific numerical values to x and y.
- In some cases it may be more efficient to use Evaluate to evaluate the vi etc. symbolically before specific numerical values are assigned to x and y.
- StreamPlot has the same options as Graphics, with the following additions and changes: [List of all options]
-
AspectRatio 1 ratio of height to width EvaluationMonitor None expression to evaluate at every function evaluation Frame True whether to draw a frame around the plot FrameTicks Automatic frame tick marks Method Automatic methods to use for the plot PerformanceGoal $PerformanceGoal aspects of performance to try to optimize PlotLayout Automatic how to position fields PlotLegends None legends to include 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 RegionBoundaryStyle Automatic how to style plot region boundaries RegionFillingStyle Automatic how to style plot region interiors 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 RegionFunction and StreamColorFunction are x, y, vx, vy, Norm[{vx,vy}].
- Possible settings for PlotLayout that show single streamlines in multiple plot panels include:
-
"Column" use separate streamlines in a column of panels "Row" use separate streamlines in a row of panels {"Column",k},{"Row",k} use k columns or rows {"Column",UpTo[k]},{"Row",UpTo[k]} use at most k columns or rows - 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 ContentSelectable Automatic whether to allow contents to be selected CoordinatesToolOptions Automatic detailed behavior of the coordinates tool 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 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 PlotLayout Automatic how to position fields PlotLegends None legends to include 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 RegionBoundaryStyle Automatic how to style plot region boundaries RegionFillingStyle Automatic how to style plot region interiors 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 allclose allBasic Examples (4)
Scope (22)
Sampling (10)
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:
Use Evaluate to evaluate the vector field symbolically before numeric assignment:
The domain may be specified by a region:
The domain may be specified by a MeshRegion:
Presentation (12)
Specify different dashings and arrowheads by setting to StreamScale:
Plot the streamlines with arrows colored according to the magnitude of the field:
Apply a variety of streamline styles:
Override the style from the theme:
Use a named appearance to draw the streamlines:
Style the streamlines as well:
Specify mesh lines with different styles:
Specify global mesh line styles:
Shade mesh regions cyclically:
Apply a variety of styles to region boundaries:
Show multiple functions as densities in separate panels:
Use a column instead of a row:
Add a legend with placeholder text:
Use the vector fields as legend labels:
Use explicit labels for each vector field:
Options (97)
AspectRatio (3)
By default, StreamPlot uses the same width and height:
Use numerical value to specify the height to width ratio:
AspectRatioAutomatic determines the ratio from the plot ranges:
Axes (4)
By default, StreamPlot uses a frame instead of axes:
Use AxesOrigin to specify where the axes intersect:
AxesOrigin (2)
AxesStyle (4)
EvaluationMonitor (2)
ImageSize (5)
Mesh (5)
MeshFunctions (3)
MeshShading (3)
PerformanceGoal (2)
PlotLayout (2)
PlotLegends (6)
PlotRange (5)
PlotTheme (2)
RegionBoundaryStyle (2)
RegionFunction (3)
ScalingFunctions (2)
StreamColorFunction (5)
By default, 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 (7)
StreamPoints (6)
Specify a specific 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:
StreamScale (9)
Create full streamlines without segmentation:
Use symbolic names to control the lengths of streamlines:
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:
StreamStyle (5)
StreamColorFunction has precedence over colors specified in StreamStyle:
Set StreamColorFunctionNone to specify colors with StreamStyle:
Applications (16)
Streamlines for the gradient field of over the unit square:
Streamlines for the Hamiltonian vector field of :
Global attractor of damped conservative system:
Combine several examples into a tabbed view:
Mouse over the tabs to get a description of the vector field:
Quadratic system with two limit cycles:
Characterize linear planar systems interactively:
Use a stream plot as a background for an interactive differential equation solution plotter:
Unfolding a double zero eigenvalue:
Generate a list of rasterized stream 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 on the field icons to switch field plots:
Generate a list of stream plots of varying :
Specify the geometry for a fluid flow:
Specify the boundary conditions for a flow that enters at the left-hand channel and exits through the two right-hand channels:
Define the Navier–Stokes equations:
Use the finite element method to solve for the steady flow velocities and pressure:
Use DensityPlot to plot the pressure and StreamPlot to plot the flow:
Properties & Relations (11)
Use ListStreamPlot for plotting data:
Use VectorPlot to plot with vectors instead of streamlines:
Use ListVectorPlot to generate a plot based on data:
Use StreamPlot3D to plot streamlines of 3D vector fields:
Use ListStreamPlot3D to plot streamlines based on data:
Use StreamDensityPlot to add a density plot of the scalar field:
Use VectorDensityPlot to plot vectors instead of streamlines:
Use ListStreamDensityPlot to generate a plot based on data:
Use ListVectorDensityPlot to plot arrows instead of streamlines:
Use LineIntegralConvolutionPlot to plot the line integral convolution of a vector field:
Use VectorDisplacementPlot to visualize the deformation of a region associated with a displacement vector field:
Use ListVectorDisplacementPlot to visualize the same deformation based on data:
Use VectorPlot3D to visualize 3D vector fields:
Use ListVectorPlot3D to generate a plot based on data:
Plot vectors on surfaces with SliceVectorPlot3D:
Use VectorDisplacementPlot3D to visualize the deformation of a 3D region associated with a displacement vector field:
Use ListVectorDisplacementPlot3D to visualize the same deformation based on data:
Plot a complex function as a vector field using streamlines:
Use vectors instead of streamlines:
Use GeoVectorPlot to plot vectors on a map:
Use GeoStreamPlot to plot streamlines instead of vectors:
Text
Wolfram Research (2008), StreamPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/StreamPlot.html (updated 2022).
CMS
Wolfram Language. 2008. "StreamPlot." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/StreamPlot.html.
APA
Wolfram Language. (2008). StreamPlot. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/StreamPlot.html