erlab.plotting.bz¶
Utilities for plotting Brillouin zones.
Functions
|
Plot a Brillouin zone, given the basis vectors. |
|
Plot a 2D hexagonal BZ overlay on the specified axes. |
|
Plot Brillouin-zone boundaries on a constant- |
|
Plot Brillouin-zone boundaries on an out-of-plane momentum slice. |
- erlab.plotting.bz.plot_bz(basis, *, reciprocal=False, rotate=0.0, offset=(0.0, 0.0), ax=None, **kwargs)[source]¶
Plot a Brillouin zone, given the basis vectors.
- Parameters:
basis (
ndarray[tuple[Any,...],dtype[floating]]) – A 2D or 3D numpy array with shape(N, N)whereN = 2or3, containing the basis vectors of the lattice. If N is 3, only the upper left 2x2 submatrix is used.reciprocal (
bool, default:False) – IfTrue, the basis vectors are interpreted as reciprocal lattice vectors.rotate (
float, default:0.0) – Rotation angle in degrees to apply to the BZ.offset (
tuple[float,float], default:(0.0, 0.0)) – Offset for the Brillouin zone center in the form of a tuple(x, y).ax (
Axes|None, default:None) – The axes to plot the BZ on. IfNone, the current axes are used.**kwargs – Additional keyword arguments passed to
matplotlib.patches.Polygon.
- erlab.plotting.bz.plot_hex_bz(a=3.54, *, reciprocal=False, rotate=0.0, offset=(0.0, 0.0), ax=None, **kwargs)[source]¶
Plot a 2D hexagonal BZ overlay on the specified axes.
- Parameters:
a (
float, default:3.54) – Lattice constant of the hexagonal lattice.reciprocal (
bool, default:False) – IfTrue,ais interpreted as the periodicity of the reciprocal lattice.rotate (
float, default:0.0) – Rotation angle in degrees to apply to the BZ.offset (
tuple[float,float], default:(0.0, 0.0)) – Offset for the Brillouin zone center in the form of a tuple(x, y).ax (
Axes|None, default:None) – The axes to plot the BZ on. IfNone, the current axes are used.**kwargs – Additional keyword arguments passed to
matplotlib.patches.RegularPolygon.
- erlab.plotting.bz.plot_in_plane_bz(bvec, *, kz=0.0, angle=0.0, bounds=None, ax=None, vertices=False, midpoints=False, vertex_kwargs=None, midpoint_kwargs=None, **line_kwargs)[source]¶
Plot Brillouin-zone boundaries on a constant-
kzplane.- Parameters:
bvec (
ndarray[tuple[Any,...],dtype[floating]]) – Reciprocal lattice basis vectors.kz (
float, default:0.0) – Out-of-plane momentum of the slice.angle (
float, default:0.0) – Rotation angle in degrees about thekzaxis.bounds (
tuple[float,float,float,float] |None, default:None) –(kx_min, kx_max, ky_min, ky_max)bounds. IfNone, bounds are inferred from the current axes limits.ax (
Axes|None, default:None) – The axes to plot the BZ boundaries on. IfNone, the current axes are used.vertices (
bool, default:False) – IfTrue, also mark BZ vertices.midpoints (
bool, default:False) – IfTrue, also mark segment midpoints.vertex_kwargs (
dict[str,Any] |None, default:None) – Additional keyword arguments passed tomatplotlib.axes.Axes.scatter()for vertices and midpoints.midpoint_kwargs (
dict[str,Any] |None, default:None) – Additional keyword arguments passed tomatplotlib.axes.Axes.scatter()for vertices and midpoints.**line_kwargs – Additional keyword arguments passed to
matplotlib.axes.Axes.plot().
- Returns:
tuple– Line artists, vertex scatter artist, and midpoint scatter artist.- Return type:
tuple[tuple[Line2D, …], PathCollection | None, PathCollection | None]
- erlab.plotting.bz.plot_out_of_plane_bz(bvec, *, k_parallel=0.0, angle=0.0, bounds=None, ax=None, vertices=False, midpoints=False, vertex_kwargs=None, midpoint_kwargs=None, **line_kwargs)[source]¶
Plot Brillouin-zone boundaries on an out-of-plane momentum slice.
- Parameters:
bvec (
ndarray[tuple[Any,...],dtype[floating]]) – Reciprocal lattice basis vectors.k_parallel (
float, default:0.0) – Fixed in-plane momentum component alongangle.angle (
float, default:0.0) – Angle in degrees of the fixed in-plane momentum direction.bounds (
tuple[float,float,float,float] |None, default:None) –(kp_min, kp_max, kz_min, kz_max)bounds. IfNone, bounds are inferred from the current axes limits.ax (
Axes|None, default:None) – The axes to plot the BZ boundaries on. IfNone, the current axes are used.vertices (
bool, default:False) – IfTrue, also mark BZ vertices.midpoints (
bool, default:False) – IfTrue, also mark segment midpoints.vertex_kwargs (
dict[str,Any] |None, default:None) – Additional keyword arguments passed tomatplotlib.axes.Axes.scatter()for vertices and midpoints.midpoint_kwargs (
dict[str,Any] |None, default:None) – Additional keyword arguments passed tomatplotlib.axes.Axes.scatter()for vertices and midpoints.**line_kwargs – Additional keyword arguments passed to
matplotlib.axes.Axes.plot().
- Returns:
tuple– Line artists, vertex scatter artist, and midpoint scatter artist.- Return type:
tuple[tuple[Line2D, …], PathCollection | None, PathCollection | None]