pythtb.TBModel.plot_bands#

TBModel.plot_bands(k_nodes, k_node_labels=None, nk=101, fig=None, ax=None, proj_orb_idx=None, proj_spin=False, bands_label=None, scat_size=3, lw=2, lc='b', ls='solid', cmap='plasma', cbar=True)[source]#

Plot the band structure along a specified path in k-space.

This function allows for customization of the plot, including projection of orbitals, spin projection, figure and axis objects, title, scatter size, line width, line color, line style, colormap, and whether to show a color bar.

Added in version 2.0.0.

Parameters:
k_nodeslist[list[float]]

List of high symmetry points (in reduced units) to plot the bands through. For example, [[0,0,0], [0, 1/2, 1/2]].

k_node_labelslist[str], optional

Labels of high symmetry points. Defaults to None.

nkint, optional

Total number of k-points to sample along the path. Defaults to 101.

proj_orb_idxlist[int], optional

List of orbital indices to project onto. Defaults to None. This will give the bands a colorscale indicating the weight of the Bloch states onto the list of orbitals.

proj_spinbool, optional

Whether to project the spin components. Defaults to False. If True, the bands will be colored according to their spin character.

figmatplotlib.figure.Figure, optional

Figure object to plot on. Defaults to None.

axmatplotlib.axes.Axes, optional

Axes object to plot on. Defaults to None.

scat_sizefloat, optional

Size of the scatter points. Defaults to 3. Only relevant if proj_spin is True or proj_orb_idx is not None.

lwfloat, optional

Line width of the band lines. Defaults to 2.

lcstr, optional

Line color of the band lines. Defaults to “b”. Irrelevant if proj_spin is True or proj_orb_idx is not None.

lsstr, optional

Line style of the band lines. Defaults to “solid”. Irrelevant if proj_spin is True or proj_orb_idx is not None.

cmapstr, optional

Colormap for the band plot. Defaults to “plasma”. Only relevant if proj_spin is True or proj_orb_idx is not None.

cbarbool, optional

Whether to show a color bar. Defaults to True. Only relevant if proj_spin is True or proj_orb_idx is not None.

Returns:

fig : matplotlib.figure.Figure ax: matplotlib.axes.Axes