Draw streamlines of a vector flow.
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.meshgrid(x_1d, y_1d)
.
x and y-velocities. The number of rows and columns must match the length of y and x, respectively.
Controls the closeness of streamlines. When density = 1
, the domain is divided into a 30x30 grid. density linearly scales this grid. Each cell in the grid can have, at most, one traversing streamline. For different densities in each direction, use a tuple (density_x, density_y).
The width of the stream lines. With a 2D array the line width can be varied across the grid. The array must have the same shape as u and v.
The streamline color. If given an array, its values are converted to colors using cmap and norm. The array must have the same shape as u and v.
Colormap
Colormap used to plot streamlines and arrows. This is only used if color is an array.
Normalize
Normalize object used to scale luminance data to 0, 1. If None
, stretch (min, max) to (0, 1). This is only used if color is an array.
Scaling factor for the arrow size.
Arrow style specification. See FancyArrowPatch
.
Minimum length of streamline in axes coordinates.
Coordinates of starting points for the streamlines in data coordinates (the same coordinates as the x and y arrays).
The zorder of the stream lines and arrows. Artists with lower zorder values are drawn first.
Maximum length of streamline in axes coordinates.
Integrate the streamline in forward, backward or both directions.
If given, the following parameters also accept a string s
, which is interpreted as data[s]
(unless this raises an exception):
x, y, u, v, start_points
Container object with attributes
lines
: LineCollection
of streamlinesarrows
: PatchCollection
containing FancyArrowPatch
objects representing the arrows half-way along stream lines.This container will probably change in the future to allow changes to the colormap, alpha, etc. for both lines and arrows, but these changes should be backward compatible.
matplotlib.axes.Axes.streamplot
© 2012–2021 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.5.1/api/_as_gen/matplotlib.axes.Axes.streamplot.html