biocircuits.streamplot
- biocircuits.streamplot(x, y, u, v, p=None, density=1, color='#1f77b4', line_width=None, alpha=1, arrow_size=7, min_length=0.1, start_points=None, max_length=4.0, integration_direction='both', arrow_level='underlay', **kwargs)
Draws streamlines of a vector field.
- Parameters:
x (1d arrays) – an evenly spaced grid.
y (1d arrays) – an evenly spaced grid.
u (2d arrays) – x and y-velocities. Number of rows should match length of y, and the number of columns should match x.
v (2d arrays) – x and y-velocities. Number of rows should match length of y, and the number of columns should match x.
p (bokeh.plotting.Figure instance, default None) – Figure to populate with glyphs. If None, create a new figure.
density (float or 2-tuple) – 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 [density_x, density_y].
color (str or 2d array, default '#1f77b4' (Bokeh default color)) – Streamline color. When given an array with the same shape as velocities, color values are converted to colors using cmap.
line_width (numeric or 2d array, default None) – vary linewidth when given a 2d array with the same shape as velocities. If None, scale linewidth with speed.
arrow_size (float) – Factor scale arrow size.
min_length (float) – Minimum length of streamline in axes coordinates.
start_points (Nx2 array) – Coordinates of starting points for the streamlines. In data coordinates, the same as the
x
andy
arrays.max_length (float) – Maximum length of streamline in axes coordinates.
integration_direction (['forward', 'backward', 'both']) – Integrate the streamline in forward, backward or both directions.
arrow_level (str) – Either ‘underlay’ or ‘overlay’.
kwargs – All other kwargs are passed to bokeh.plotting.figure() when generating the figure.
- Return type:
bokeh.plotting.Figure instance populated with streamplot.
Notes