kwant.plotter.
map
(sys, 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
.
The system for whose sites value is to be plotted.
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.
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.
matplotlib
color map or NoneThe color map used for sites and optionally hoppings, if None,
matplotlib
default is used.
The lower saturation limit for the colormap; values returned by value which are smaller than this will saturate
The upper saturation limit for the colormap; valued returned by value which are larger than this will saturate
Reference length. If not given, it is determined as a typical nearest neighbor distance.
Passed to scipy.interpolate.griddata
: “nearest” (default), “linear”,
or “cubic”
Number of pixels per reference length. Defaults to 3.
number of lead unit cells that should be plotted to indicate the position of leads. Defaults to 0.
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.
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.
Transformation to be applied to the site position.
Areas without sites are filled with this color.
A figure with the output if ax is not set, else None.
See also
Notes
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.