radtools.MatplotlibBackend#

class radtools.MatplotlibBackend(fig=None, ax=None, background=True, focal_length=0.2)[source]#

Plotting engine for the lattice with matplotlib.

Added in version 0.8.5.

Parameters:
figmatplotlib figure, optional

Figure to plot on. If not provided, a new figure and ax is created.

axmatplotlib axis, optional

Axis to plot on. If not provided, a new axis is created.

backgroundbool, default True

Whether to keep the axis on the plot.

focal_lengthfloat, default 0.2

See: 3D plot projection types

Attributes:
figmatplotlib figure

Figure to plot on.

axmatplotlib axis

Axis to plot on.

artistsdict

Dictionary of the artists. Keys are the plot kinds, values are the lists of artists.

Methods:

clear()

Clear the axis.

legend(**kwargs)

Add legend to the figure.

plot(lattice[, kind])

Main plotting function of the Lattice.

plot_brillouin(*args[, color])

Plot brillouin zone.

plot_brillouin_kpath(*args[, zone_color, ...])

Plot brillouin zone and kpath.

plot_conventional(*args, **kwargs)

Plot conventional unit cell.

plot_kpath(lattice[, color, label, normalize])

Plot k path in the reciprocal space.

plot_primitive(*args, **kwargs)

Plot primitive unit cell.

plot_unit_cell(lattice[, vectors, color, ...])

Plot real or reciprocal space unit cell.

plot_wigner_seitz(lattice[, vectors, color, ...])

Plot Wigner-Seitz unit cell.

remove([kind])

Remove a set of artists from the plot.

save([output_name, elev, azim])

Save the figure in the file.

show([elev, azim])

Show the figure in the interactive mode.