pythtb.TBModel.visualize_3d#
- TBModel.visualize_3d(draw_hoppings=True, show_model_info=True, site_colors=None, site_names=None, show=True)[source]#
Visualize a 3D tight-binding model using
Plotly.This function creates an interactive 3D plot of your tight-binding model, showing the unit-cell origin, lattice vectors (with arrowheads), orbitals, hopping lines, and (optionally) an eigenstate overlay with marker sizes proportional to amplitude and colors reflecting the phase.
Added in version 2.0.0.
- Parameters:
- draw_hoppingsbool, optional
Whether to draw hopping lines between orbitals.
- show_model_infobool, optional
Whether to display model information as an annotation.
- site_colorslist of str, optional
List of colors (e.g. hex strings) for each orbital. If not provided, a colormap is used.
- site_nameslist of str, optional
List of names for each orbital. If not provided, orbitals are named “Orbital 0”, “Orbital 1”, etc.
- showbool or str, optional
Whether to display the plot immediately.
- Returns:
- plotly.graph_objs._figure.Figure, optional
A Plotly Figure object. Returned only if show is False.