kwant.plotter.
streamplot
(field, box, cmap=None, bgcolor=None, linecolor='k', max_linewidth=3, min_linewidth=1, density=0.2222222222222222, colorbar=True, file=None, show=True, dpi=None, fig_size=None, ax=None, vmax=None)[source]¶Draw streamlines of a flow field in Kwant style
Solid colored streamlines are drawn, superimposed on a color plot of the flow speed that may be disabled by setting bgcolor. The width of the streamlines is proportional to the flow speed. Lines that would be thinner than min_linewidth are blended in a perceptually correct way into the background color in order to create the illusion of arbitrarily thin lines. (This is done because some plot backends like PDF do not support lines of arbitrarily thin width.)
Internally, this routine uses matplotlib’s streamplot.
2d array of 2d vectors.
the extents of field: ((x0, x1), (y0, y1))
Colormap for the background color plot. When not set the colormap “kwant_red” is used by default, unless bgcolor is set.
The solid color of the background. Mutually exclusive with cmap.
Color of the flow lines.
Width of lines at maximum flow speed.
Minimum width of lines before blending into the background color begins.
Number of flow lines per point of the field. The default value
of 2/9 is chosen to show two lines per default width of the
interpolation bump of interpolate_current
.
Whether to show a colorbar if a colormap is used. Ignored if ax is provided.
The output file. If None, output will be shown instead.
Whether matplotlib.pyplot.show()
is to be called, and the output is
to be shown immediately. Defaults to True.
Number of pixels per inch. If not set the matplotlib
default is
used.
Figure size (width, height) in inches. If not set, the default
matplotlib
value is used.
matplotlib.axes.Axes
instance or NoneIf ax is not None, no new figure is created, but the plot is done within the existing Axes ax. in this case, file, show, dpi and fig_size are ignored.
The upper saturation limit for the colormap; flows higher than this will saturate. Note that there is no corresponding vmin option, vmin being fixed at zero.
A figure with the output if ax is not set, else None.