StreamPlot3D [{vx,vy,vz},{x,xmin,xmax},{y,ymin,ymax},{z,zmin,zmax}]
plots streamlines for the vector field {vx,vy,vz} as functions of x, y and z.
StreamPlot3D [{vx,vy,vz},{x,y,z}∈reg]
takes the variables {x,y,z} to be in the geometric region reg.
StreamPlot3D
StreamPlot3D [{vx,vy,vz},{x,xmin,xmax},{y,ymin,ymax},{z,zmin,zmax}]
plots streamlines for the vector field {vx,vy,vz} as functions of x, y and z.
StreamPlot3D [{vx,vy,vz},{x,y,z}∈reg]
takes the variables {x,y,z} to be in the geometric region reg.
Details and Options
- StreamPlot3D is known as a 3D stream plot or streamline plot. Besides lines, streamlines can also be displayed as tubes (stream tubes) and ribbons (stream ribbons).
- StreamPlot3D 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 .
- StreamPlot3D by default shows enough streamlines to achieve a roughly uniform density throughout the plot and shows no background scalar field.
- StreamPlot3D treats the variables x, y and z as local, effectively using Block .
- StreamPlot3D has attribute HoldAll and evaluates the vi etc. only after assigning specific numerical values to x, y and z. In some cases, it may be more efficient to use Evaluate to evaluate the vi etc. symbolically first.
- StreamPlot3D has the same options as Graphics3D , with the following additions and changes: [List of all options]
-
- The arguments supplied to functions in RegionFunction and StreamColorFunction are x,y,z,vx,vy,vz,Norm [{vx,vy,vz}].
- Possible settings for StreamMarkers include:
-
"Arrow" lines with 2D arrowheads"Arrow3D" tubes with 3D arrowheads"Line" lines"Tube" tubes"Ribbon" flat ribbons"ArrowRibbon" ribbons with built-in arrowheads
- With StreamScale Automatic and "arrow" stream markers, the streamlines are split into segments to make it easier to see the direction of the streamlines.
- Possible settings for StreamScale are:
-
Automatic automatically determine the streamline segmentsFull show the streamline as one piece{len,npts,ratio} use explicit specification of streamline segmentation
- The length len of streamline segments can be one of the following forms:
-
Automatic automatically determine the lengthNone show the streamline as one pieces use a length s that is a fraction of the graphic size
- The number of points npts used to draw each segment can be Automatic or a specific number of points.
- The aspect ratio ratio specifies how wide the cross section of a streamline is relative to the streamline segment.
- Possible settings for ScalingFunctions include:
-
{sx,sy,sz} scale x, y and z 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
-
ImageMargins 0. the margins to leave around the graphicPreserveImageOptions Automatic whether to preserve image options when displaying new versions of the same graphicRotationAction "Fit" how to render after interactive rotation
List of all options
Examples
open all close allBasic Examples (4)
Plot streamlines through a vector field in 3D:
Use tubes to show the streamlines:
Include a legend for the vector field magnitudes:
Plot streamlines over an arbitrary region:
Scope (12)
Sampling (3)
Specify the density of seed points for the streamlines:
Specify specific seed points for the streamlines:
Plot streamlines over a specified region:
Presentation (9)
Streamlines are drawn as lines by default:
Use 3D tubes for the streamlines:
Use flat ribbons:
Use "arrow" versions of the stream markers to indicate the direction of flow along the streamlines:
Arrows on tubes:
Ribbons are turned into arrows by tapering the heads and notching the tails of the streamlines:
Use a single color for the streamlines:
Use a named color gradient for the streamlines:
Include a legend for the field magnitude:
Use StreamScale to split streamlines into multiple shorter line segments:
Increase the number of points in each segment and increase the marker aspect ratio:
Use a theme:
Use a log scale for the x axis:
Reverse the y scale so it increases toward the bottom:
Options (70)
Axes (3)
AxesLabel (3)
No axes labels are drawn by default:
Place a label on the axis:
Specify axes labels:
AxesOrigin (2)
The position of the axes is determined automatically:
Specify an explicit origin for the axes:
AxesStyle (4)
Change the style for the axes:
Specify the style of each axis:
Use different styles for the ticks and the axes:
Use different styles for the labels and the axes:
BoxRatios (2)
ImageSize (7)
Use named sizes, such as Tiny , Small , Medium and Large :
Specify the width of the plot:
Specify the height of the plot:
Allow the width and height to be up to a certain size:
Specify the width and height for a graphic, padding with space if necessary:
Setting AspectRatio Full will fill the available space:
Use maximum sizes for the width and height:
Use ImageSize Full to fill the available space in an object:
Specify the image size as a fraction of the available space:
PlotLegends (3)
No legends are included by default:
Include a legend that indicates the vector field norm:
Specify the location of the legend:
PlotTheme (1)
Specify a theme:
RegionBoundaryStyle (4)
Show the region defined by a RegionFunction :
Use None to avoid showing the boundary:
Specify the color of the region boundary:
The boundaries of full rectangular regions are not shown:
RegionFunction (4)
Plot streamlines in a ball:
Plot streams only where the field magnitude exceeds a given threshold:
Region functions depend, in general, on seven arguments:
Use RegionBoundaryStyle None to avoid showing the boundary:
ScalingFunctions (1)
Use a log scale for the x axis:
Reverse the y scale so it increases toward the bottom:
StreamColorFunction (4)
Color the streams by their norm:
Use any named color gradient from ColorData :
Color the streamlines according to their x value:
Use StreamColorFunctionScaling False to get unscaled values:
StreamColorFunctionScaling (2)
By default, scaled values are used:
Use StreamColorFunctionScaling False to get unscaled values:
StreamMarkers (5)
By default, lines are used:
Draw the streamlines as tubes:
Draw them as flat ribbons:
"Arrow" stream markers automatically break the streamlines into shorter segments:
Use 3D arrowheads on tubes:
Use directional ribbons:
Make segmented markers continuous:
Break continuous markers into segments:
StreamPoints (4)
Use automatically determined stream points to seed the curves:
Specify a maximum number of streamlines:
Give specific seed points for the streams:
Use coarsely spaced streamlines:
Use more finely spaced streamlines:
StreamScale (9)
Segmented markers have default lengths, numbers of points and aspect ratios:
Modify the lengths of the segments:
Specify the number of sample points in each segment:
Modify the aspect ratios for the stream markers:
Make segmented markers continuous:
Break continuous markers into segments:
The aspect ratio controls the thickness of ribbons and tubes:
Increase the width of the ribbons and tubes:
The aspect ratio controls the sizes of arrowheads:
Control the number of points in each segment:
StreamStyle (3)
Change the appearance of the streamlines:
StreamColorFunction takes precedence over StreamStyle :
Use StreamColorFunction None to specify a streamline color with StreamStyle :
Ticks (6)
Ticks are placed automatically in each plot:
Use Ticks None to not draw any tick marks:
Place tick marks at specific positions:
Draw tick marks at the specified positions with the specified labels:
Specify tick marks with scaled lengths:
Customize each tick with position, length, labeling and styling:
TicksStyle (3)
By default, the ticks and tick labels use the same styles as the axis:
Specify overall tick style, including the tick labels:
Specify tick style for each of the axes:
Applications (10)
Basic Applications (1)
Consider a vector differential equation where f(x)=If[TemplateBox[{x}, Norm]<=1,x,{1,0,0}] is defined piecewise.
Visualize solutions of using seed points for the streamlines that are inside the unit sphere:
Fluid Flow (3)
Consider Stokes flow for a point force of the form , where is a constant vector and is a Dirac delta function. For example, a force pointing down:
Define the fluid velocity vector , the pressure and the viscosity :
Confirm that the equations for Stokes flow are satisfied so that and :
Plot streamlines for the flow:
Visualize Stokes flow around a unit sphere. Define the fluid velocity vector , the pressure , the viscosity and the far-field fluid speed :
Confirm that the equations for Stokes flow are satisfied so that and :
Plot streamlines for the flow:
Plot the pressure for the flow:
Specify the Navier–Stokes equations for a fluid through a pipe with a bulge:
Specify the geometry for the flow:
Specify the boundary conditions for flow from left to right:
Solve for the flow velocities and pressure:
Specify seed points for the streamlines:
Plot the streamlines for the flow:
Electrical Systems (1)
Visualize electric field lines for a dipole:
The streamlines appear to have uniform color because of the extremely rapid change in the vector field norm near the point charges at . Bounding the magnitude of the vector field norm with a region function makes the colors visible:
Add spheres to indicate the positive (red) and negative (black) point charges:
Arrows can be used to provide more information, but the colors change because arrow markers are colored by the field magnitude at the tip of the arrow:
Use a custom StreamColorFunction to exert more control over the colors:
Miscellaneous (5)
Lorenz attractor:
Use ribbons or arrow ribbons to visualize the torsion of a twisted cubic:
Visualize solutions of differential equations on manifolds:
Visualize streamlines for Poiseuille flow. The fluid speed is fastest along the central axis:
Visualize solutions of Euler's equations for a rotating rigid body:
Properties & Relations (9)
Use VectorPlot3D to visualize a field with discrete arrows:
Use ListStreamPlot3D or ListVectorPlot3D to generate plots based on data:
Use StreamPlot to plot streamlines of 2D vector fields:
Use VectorPlot to plot with vectors instead of streamlines:
Generate plots based on data:
Use StreamDensityPlot to add a density plot of the scalar field:
Use VectorDensityPlot to plot with arrows instead of streamlines:
Generate plots based on data:
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:
Plot vectors along 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:
Use ComplexVectorPlot or ComplexStreamPlot to visualize a complex function of a complex variable as a vector field or with streamlines:
Use GeoVectorPlot to plot vectors on a map:
Use GeoStreamPlot to plot streamlines instead of vectors:
Possible Issues (3)
Tube StreamMarkers can be distorted by the BoxRatios :
Carefully adjusting the BoxRatios can eliminate the tube distortion:
The colors of "Arrow" and "Arrow3D" stream markers are determined at the tip of the arrow, which can result in inconsistent colors for long arrows:
Related Guides
Text
Wolfram Research (2021), StreamPlot3D, Wolfram Language function, https://reference.wolfram.com/language/ref/StreamPlot3D.html (updated 2022).
CMS
Wolfram Language. 2021. "StreamPlot3D." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/StreamPlot3D.html.
APA
Wolfram Language. (2021). StreamPlot3D. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/StreamPlot3D.html
BibTeX
@misc{reference.wolfram_2025_streamplot3d, author="Wolfram Research", title="{StreamPlot3D}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/StreamPlot3D.html}", note=[Accessed: 24-November-2025]}
BibLaTeX
@online{reference.wolfram_2025_streamplot3d, organization={Wolfram Research}, title={StreamPlot3D}, year={2022}, url={https://reference.wolfram.com/language/ref/StreamPlot3D.html}, note=[Accessed: 24-November-2025]}