pythtb.Lattice.visualize#

Lattice.visualize(proj_plane=None, n_cells=1)[source]#

Visualizes the lattice geometry.

This function creates a 2D plot of your tight-binding model, showing the unit-cell origin, lattice vectors (with arrowheads), and orbitals.

Parameters:
proj_planelist of int, optional

List of two integers specifying the directions to project onto. For example, in a 3D model, proj_plane=[0, 2] would project onto the x-z plane. If not provided, the function will attempt to automatically select a suitable projection plane based on the model’s dimensionality.

n_cellsint, optional

Number of unit cells to display along each lattice vector. Default is 1.

Returns:
figmatplotlib.figure.Figure
axmatplotlib.axes.Axes

Notes

  • This function is intended for visualizing two dimensional lattices. For three-dimensional visualizations, consider using the visualize_3d() method.