Band Structure Configuration API

class pyprocar.cfg.band_structure.BandStructureConfig(plot_type: ~pyprocar.cfg.base.PlotType, custom_settings: ~typing.Dict[str, ~typing.Any] = <factory>, modes: ~typing.List[str] = <factory>, color: str = 'black', spin_colors: ~typing.Tuple[str] = <factory>, colorbar_title: str = 'Atomic Orbital Projections', colorbar_title_size: int = 15, colorbar_title_padding: int = 20, colorbar_tick_labelsize: int = 10, cmap: str = 'jet', clim: ~typing.Tuple[float, float] | None = (0.0, 1.0), fermi_color: str = 'blue', fermi_linestyle: str = 'dotted', fermi_linewidth: float = 1, grid: bool = False, grid_axis: str = 'both', grid_color: str = 'grey', grid_linestyle: str = 'solid', grid_linewidth: float = 1, grid_which: str = 'major', label: ~typing.Tuple[str] = <factory>, legend: bool = True, linestyle: ~typing.Tuple[str] = <factory>, linewidth: ~typing.Tuple[float] = <factory>, marker: ~typing.Tuple[str] = <factory>, markersize: ~typing.Tuple[float] = <factory>, opacity: ~typing.Tuple[float] = <factory>, plot_color_bar: bool = True, savefig: str | None = None, title: str | None = None, weighted_color: bool = True, weighted_width: bool = False, figure_size: ~typing.Tuple[int] = <factory>, dpi: int = 300, colorbar_tick_params: ~typing.Dict[str, any] = <factory>, colorbar_label_params: ~typing.Dict[str, any] = <factory>, x_label: str = 'K vector', x_label_params: ~typing.Dict[str, any] = <factory>, y_label_params: ~typing.Dict[str, any] = <factory>, title_params: ~typing.Dict[str, any] = <factory>, major_y_tick_params: ~typing.Dict[str, any] = <factory>, minor_y_tick_params: ~typing.Dict[str, any] = <factory>, major_x_tick_params: ~typing.Dict[str, any] = <factory>, multiple_locator_y_major_value: float | None = None, multiple_locator_y_minor_value: float | None = None)[source]

Bases: BaseConfig

Configuration class for plotting band structures with custom options.

Parameters:
  • color (str, optional (default ‘black’)) – Color for the plot lines.

  • spin_colors (Tuple[str], optional) – Colors for the spin texture lines.

  • colorbar_title (str, optional) – Title of the colorbar.

  • colorbar_title_size (int, optional) – Font size of the title of the colorbar.

  • colorbar_title_padding (int, optional) – Padding of the title of the colorbar.

  • colorbar_tick_labelsize (int, optional) – Size of the tick labels on the colorbar.

Plot Appearance:
  • cmap (str, optional (default ‘jet’)) – The colormap used for the plot.

  • clim (Tuple[float, float], optional) – The color scale limits for the color bar.

  • fermi_color (str, optional) – Color of the Fermi line.

  • fermi_linestyle (str, optional) – The linestyle of the Fermi line.

  • fermi_linewidth (float, optional) – The linewidth of the Fermi line.

  • grid (bool, optional) – If true, a grid will be shown on the plot.

  • grid_axis (str, optional) – Which axis (or both) the grid lines should be drawn on.

  • grid_color (str, optional) – The color of the grid lines.

  • grid_linestyle (str, optional) – The linestyle of the grid lines.

  • grid_linewidth (float, optional) – The linewidth of the grid lines.

  • grid_which (str, optional) – Which grid lines to draw (major, minor, or both).

  • label (Tuple[str], optional) – The labels for the plot lines.

  • legend (bool, optional) – If true, a legend will be shown on the plot.

  • linestyle (Tuple[str], optional) – The linestyles for the plot lines.

  • linewidth (Tuple[float], optional) – The linewidths for the plot lines.

  • marker (Tuple[str], optional) – The marker styles for the plot points.

  • markersize (Tuple[float], optional) – The size of the markers for the plot points.

  • opacity (Tuple[float], optional) – The opacities for the plot lines.

  • plot_color_bar (bool, optional) – If true, a color bar will be shown on the plot.

  • savefig (str, optional) – The file name to save the figure. If null, the figure will not be saved.

  • title (str, optional) – The title for the plot. If null, no title will be displayed.

  • weighted_color (bool, optional) – If true, the color of the lines will be weighted.

  • weighted_width (bool, optional) – If true, the width of the lines will be weighted.

  • figure_size (Tuple[int], optional) – The size of the figure (width, height) in inches.

  • dpi (str, optional) – The resolution in dots per inch. If ‘figure’, use the figure’s dpi value.

colorbar_tick_paramsDict[str, any], optional

The colorbar tick parameters, by default None

colorbar_label_paramsDict[str, any], optional

The colorbar label parameters, by default None

x_label_paramsDict[str, any], optional

The x label parameters, by default None

y_label_paramsDict[str, any], optional

The y label parameters, by default None

title_paramsDict[str, any], optional

The title parameters, by default None

major_x_tick_paramsDict[str, any], optional

The major x tick parameters, by default None

major_y_tick_paramsDict[str, any], optional

The major y tick parameters, by default None

minor_y_tick_paramsDict[str, any], optional

The minor y tick parameters, by default None

major_y_locatormatplotlib.ticker.Locator, optional

The major y locator, by default None

minor_y_locatormatplotlib.ticker.Locator, optional

The minor y locator, by default None

multiple_locator_y_major_valuefloat, optional

The major value for the multiple locator, by default None

multiple_locator_y_minor_valuefloat, optional

The minor value for the multiple locator, by default None

Methods

__post_init__():

Post-initialization to set additional properties like plot_type.

Examples

To initialize a basic configuration with the default settings:

>>> config = BandStructureConfig()

To customize the plot with a specific colormap and line styles:

>>> custom_config = BandStructureConfig(cmap='magma', linestyle=('dotted', 'dashed'))
as_dict()[source]

Returns a dictionary of the configuration settings.

clim: Tuple[float, float] | None = (0.0, 1.0)
cmap: str = 'jet'
color: str = 'black'
colorbar_label_params: Dict[str, any]
colorbar_tick_labelsize: int = 10
colorbar_tick_params: Dict[str, any]
colorbar_title: str = 'Atomic Orbital Projections'
colorbar_title_padding: int = 20
colorbar_title_size: int = 15
dpi: int = 300
fermi_color: str = 'blue'
fermi_linestyle: str = 'dotted'
fermi_linewidth: float = 1
figure_size: Tuple[int]
grid: bool = False
grid_axis: str = 'both'
grid_color: str = 'grey'
grid_linestyle: str = 'solid'
grid_linewidth: float = 1
grid_which: str = 'major'
label: Tuple[str]
legend: bool = True
linestyle: Tuple[str]
linewidth: Tuple[float]
major_x_tick_params: Dict[str, any]
major_y_locator = None
major_y_tick_params: Dict[str, any]
marker: Tuple[str]
markersize: Tuple[float]
minor_y_locator = None
minor_y_tick_params: Dict[str, any]
modes: List[str]
multiple_locator_y_major_value: float = None
multiple_locator_y_minor_value: float = None
opacity: Tuple[float]
plot_color_bar: bool = True
savefig: str | None = None
spin_colors: Tuple[str]
title: str | None = None
title_params: Dict[str, any]
weighted_color: bool = True
weighted_width: bool = False
x_label: str = 'K vector'
x_label_params: Dict[str, any]
y_label_params: Dict[str, any]
class pyprocar.cfg.band_structure.BandStructureMode(value)[source]

Bases: Enum

An enumeration for defining the modes of Band Structure representations.

Variables:
  • PLAIN (str) – Represents the band structure in a simple, where the colors are the different bands.

  • PARAMETRIC (str) – Represents the band structure in a parametric form, summing over the projections.

  • SACATTER (str) – Represents the band structure in a scatter plot, where the colors are the different bands.

  • ATOMIC (str) – Represents the band structure in an atomic level plot, plots singlr kpoint bands.

  • OVERLAY (str) – Represents the band structure in an overlay plot, where the colors are the selected projections

  • OVERLAY_SPECIES (str) – Represents the band structure in an overlay plot, where the colors are the different projection of the species.

  • OVERLAY_ORBITALS (str) – Represents the band structure in an overlay plot, where the colors are the different projection of the orbitals.

ATOMIC = 'atomic'
OVERLAY = 'overlay'
OVERLAY_ORBITALS = 'overlay_orbitals'
OVERLAY_SPECIES = 'overlay_species'
PARAMETRIC = 'parametric'
PLAIN = 'plain'
SACATTER = 'scatter'
class pyprocar.cfg.band_structure.BandStructureProperty(value)[source]

Bases: Enum

An enumeration for defining the properties that can be visualized on the BandStructure.