kwant.plotter.scalarplot

kwant.plotter.scalarplot(field, box, cmap=None, colorbar=True, file=None, show=True, dpi=None, fig_size=None, ax=None, vmin=None, vmax=None, background='#e0e0e0')[source]

Draw a scalar field in Kwant style

Internally, this routine uses matplotlib’s imshow.

Parameters
field2d arraylike of float

2d scalar field to plot.

boxpair of pair of float

the realspace extents of field: ((x0, x1), (y0, y1))

cmapcolormap, optional

Colormap for the background color plot. When not set the colormap “kwant_red” is used by default.

colorbarbool, default: True

Whether to show a colorbar if a colormap is used. Ignored if ax is provided.

filestring or file object, optional

The output file. If not provided, output will be shown instead.

showbool, default: True

Whether matplotlib.pyplot.show() is to be called, and the output is to be shown immediately.

dpifloat, optional

Number of pixels per inch. If not set the matplotlib default is used.

fig_sizetuple, optional

Figure size (width, height) in inches. If not set, the default matplotlib value is used.

axmatplotlib.axes.Axes instance, optional

If ax is provided, 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.

vmin, vmaxfloat, optional

The lower/upper saturation limit for the colormap.

backgroundmatplotlib color spec

Areas outside the system are filled with this color.

Returns
figmatplotlib figure

A figure with the output if ax is not set, else None.

Previous topic

kwant.plotter.streamplot

Next topic

kwant.plotter.interpolate_current

This Page