streamslice
Draws streamlines with direction arrows, evenly spaced across a vector field.
Category: Graphics > 2-D and 3-D Plots
Syntax
streamslice(X, Y, U, V)
Draws evenly spaced 2-D streamlines with arrows.
streamslice(X, Y, U, V, density)
Sets the spacing of the lines.
h = streamslice(___)
Also returns the handles.
Description
Unlike streamline, the starting points are chosen automatically so the lines are spread evenly, and arrowheads mark the direction. It is a quick way to visualize a planar flow field without choosing starting points.
Input arguments
X, Y- Grid coordinates.
U, V- Vector components.
density- Scalar that scales the number of lines. The default is 1.
Output arguments
h- Handles of the lines and arrows.
Example
Rotation field
[x, y] = meshgrid(-2:0.25:2);
streamslice(x, y, -y, x)
axis equal
In the app, the figure is drawn below the code.