streamline

Draws streamlines from precomputed vertices.

Category: Graphics > 2-D and 3-D Plots

Syntax

streamline(verts)

Draws the lines in the cell array verts.

streamline(X, Y, U, V, startx, starty)

Computes 2-D streamlines and draws them.

h = streamline(___)

Also returns the line handles.

Description

The function only draws; computing the paths is the job of stream2 and stream3. Splitting the two steps lets you inspect or filter the vertices before plotting.

Input arguments

verts
Cell array of vertex matrices from stream2 or stream3.
X, Y, U, V, startx, starty
Grid, vector field and starting points, as in stream2.

Output arguments

h
Handles of the line objects, one per streamline.

Example

Two streamlines of a rotation field

[x, y] = meshgrid(-2:0.5:2);
u = -y;
v = x;
verts = stream2(x, y, u, v, [1 0.5], [0 0]);
h = streamline(verts);
axis equal
disp(numel(h))
Output
     2

See also

stream2 stream3 streamslice quiver