MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / streamplot

Function streamplot

lib/matplotlib/streamplot.py:18–293  ·  view source on GitHub ↗

Draw streamlines of a vector flow. Parameters ---------- x, y : 1D/2D arrays Evenly spaced strictly increasing arrays to make a grid. If 2D, all rows of *x* must be equal and all columns of *y* must be equal; i.e., they must be as if generated by ``np.meshg

(axes, x, y, u, v, density=1, linewidth=None, color=None,
               cmap=None, norm=None, arrowsize=1, arrowstyle='-|>',
               minlength=0.1, transform=None, zorder=None, start_points=None,
               maxlength=4.0, integration_direction='both',
               broken_streamlines=True, *, integration_max_step_scale=1.0,
               integration_max_error_scale=1.0, num_arrows=1)

Source from the content-addressed store, hash-verified

16
17
18def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
19 cmap=None, norm=None, arrowsize=1, arrowstyle='-|>',
20 minlength=0.1, transform=None, zorder=None, start_points=None,
21 maxlength=4.0, integration_direction='both',
22 broken_streamlines=True, *, integration_max_step_scale=1.0,
23 integration_max_error_scale=1.0, num_arrows=1):
24 """
25 Draw streamlines of a vector flow.
26
27 Parameters
28 ----------
29 x, y : 1D/2D arrays
30 Evenly spaced strictly increasing arrays to make a grid. If 2D, all
31 rows of *x* must be equal and all columns of *y* must be equal; i.e.,
32 they must be as if generated by ``np.meshgrid(x_1d, y_1d)``.
33 u, v : 2D arrays
34 *x* and *y*-velocities. The number of rows and columns must match
35 the length of *y* and *x*, respectively.
36 density : float or (float, float)
37 Controls the closeness of streamlines. When ``density = 1``, the domain
38 is divided into a 30x30 grid. *density* linearly scales this grid.
39 Each cell in the grid can have, at most, one traversing streamline.
40 For different densities in each direction, use a tuple
41 (density_x, density_y).
42 linewidth : float or 2D array
43 The width of the streamlines. With a 2D array the line width can be
44 varied across the grid. The array must have the same shape as *u*
45 and *v*.
46 color : :mpltype:`color` or 2D array
47 The streamline color. If given an array, its values are converted to
48 colors using *cmap* and *norm*. The array must have the same shape
49 as *u* and *v*.
50 cmap, norm
51 Data normalization and colormapping parameters for *color*; only used
52 if *color* is an array of floats. See `~.Axes.imshow` for a detailed
53 description.
54 arrowsize : float
55 Scaling factor for the arrow size.
56 arrowstyle : str
57 Arrow style specification.
58 See `~matplotlib.patches.FancyArrowPatch`.
59 minlength : float
60 Minimum length of streamline in axes coordinates.
61 start_points : (N, 2) array
62 Coordinates of starting points for the streamlines in data coordinates
63 (the same coordinates as the *x* and *y* arrays).
64 zorder : float
65 The zorder of the streamlines and arrows.
66 Artists with lower zorder values are drawn first.
67 maxlength : float
68 Maximum length of streamline in axes coordinates.
69 integration_direction : {'forward', 'backward', 'both'}, default: 'both'
70 Integrate the streamline in forward, backward or both directions.
71 data : indexable object, optional
72 DATA_PARAMETER_PLACEHOLDER
73 broken_streamlines : boolean, default: True
74 If False, forces streamlines to continue until they
75 leave the plot domain. If True, they may be terminated if they

Callers

nothing calls this directly

Calls 15

mask2gridMethod · 0.95
data2gridMethod · 0.95
grid2dataMethod · 0.95
StreamMaskClass · 0.85
DomainMapClass · 0.85
_get_integratorFunction · 0.85
_gen_starting_pointsFunction · 0.85
integrateFunction · 0.85
interpgridFunction · 0.85
normFunction · 0.85
StreamplotSetClass · 0.85
minMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…