, value, colorbar=True, cmap=None, vmin=None, vmax=None, a=None, method='nearest', oversampling=3, num_lead_cells=0, file=None, show=True, dpi=None, fig_size=None, ax=None, pos_transform=None, background='#e0e0e0')[source]

Show interpolated map of a function defined for the sites of a system.

Create a pixmap representation of a function of the sites of a system by calling mask_interpolate and show this pixmap using matplotlib.

This function is similar to density, but is more suited to the case where you want site-level resolution of the quantity that you are plotting. If your system has many sites you may get more appealing plots by using density.

syskwant.system.FiniteSystem or kwant.builder.Builder

The system for whose sites value is to be plotted.

valuefunction or list

Function which takes a site and returns a value if the system is a builder, or a list of function values for each system site of the finalized system.

colorbarbool, optional

Whether to show a color bar if numerical data has to be plotted. Defaults to True. If ax is provided, the colorbar is never plotted.

cmapmatplotlib color map or None

The color map used for sites and optionally hoppings, if None, matplotlib default is used.

vminfloat, optional

The lower saturation limit for the colormap; values returned by value which are smaller than this will saturate

vmaxfloat, optional

The upper saturation limit for the colormap; valued returned by value which are larger than this will saturate

afloat, optional

Reference length. If not given, it is determined as a typical nearest neighbor distance.

methodstring, optional

Passed to scipy.interpolate.griddata: “nearest” (default), “linear”, or “cubic”

oversamplinginteger, optional

Number of pixels per reference length. Defaults to 3.

num_lead_cellsinteger, optional

number of lead unit cells that should be plotted to indicate the position of leads. Defaults to 0.

filestring or file object or None

The output file. If None, output will be shown instead.


Whether is to be called, and the output is to be shown immediately. Defaults to True.

axmatplotlib.axes.Axes instance or None

If 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.

pos_transformfunction or None

Transformation to be applied to the site position.

backgroundmatplotlib color spec

Areas without sites are filled with this color.

figmatplotlib figure

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


  • When plotting a system on a square lattice and method is “nearest”, it makes sense to set oversampling to 1. Then, each site will correspond to exactly one pixel.

Previous topic


Next topic


This Page