FermiSlicePlotter¶
- class ifermi.plot.FermiSlicePlotter(fermi_slice, symprec=0.001)[source]¶
Bases:
object
Class to plot 2D isolines through a FermiSurface.
- Parameters:
fermi_slice (
FermiSlice
) – A slice through a Fermi surface.symprec (
float
) – The symmetry precision in Angstrom for determining the high symmetry k-point labels.
- get_plot(ax=None, spin=None, colors=None, color_properties=True, vector_properties=False, projection_axis=None, scale_linewidth=False, vector_spacing=0.2, cmin=None, cmax=None, vnorm=None, hide_slice=False, hide_labels=False, hide_cell=False, plot_index=None, arrow_pivot='tail', slice_kwargs=None, cbar_kwargs=None, quiver_kwargs=None, bz_kwargs=None, sym_pt_kwargs=None, sym_label_kwargs=None)[source]¶
Plot the Fermi slice.
- Parameters:
spin (
Spin
|None
) – Which spin channel to plot. By default plot both spin channels if available.colors (
str
|dict
|list
|None
) –The color specification for the iso-surfaces. Valid options are:
A single color to use for all Fermi isolines, specified as a tuple of rgb values from 0 to 1. E.g., red would be
(1, 0, 0)
.A list of colors, specified as above.
A dictionary of
{Spin.up: color1, Spin.down: color2}
, where the colors are specified as above.A string specifying which matplotlib colormap to use. See https://matplotlib.org/tutorials/colors/colormaps.html for more information.
None
, in which case the default colors will be used.
color_properties (
str
|bool
) – Whether to use the properties to color the Fermi isolines. If the properties is a vector then the norm of the properties will be used. Note, this will only take effect if the Fermi slice has properties. If set to True, the viridis colormap will be used. Alternative colormaps can be selected by settingcolor_properties
to a matplotlib colormap name. This setting will override thecolors
option. For vector properties, the arrows are colored according to the norm of the properties by default. If used in combination with theprojection_axis
option, the color will be determined by the dot product of the properties with the projection axis.vector_properties (
str
|bool
) – Whether to plot arrows for vector properties. Note, this will only take effect if the Fermi slice has vector properties. If set to True, the viridis colormap will be used. Alternative colormaps can be selected by settingvector_properties
to a matplotlib colormap name. By default, the arrows are colored according to the norm of the properties. If used in combination with theprojection_axis
option, the color will be determined by the dot product of the properties with the projection axis.projection_axis (
tuple
[int
,int
,int
] |None
) – Projection axis that can be used to calculate the color of vector properties. If None, the norm of the properties will be used, otherwise the color will be determined by the dot product of the properties with the projection axis. Only has an effect when used with thevector_properties
option.scale_linewidth (
bool
|float
) – Scale the linewidth by the absolute value of the segment properties. Can be true, false or a number. If a number, then this will be used as the max linewidth for scaling.vector_spacing (
float
) – The rough spacing between arrows. Uses a custom algorithm for resampling the Fermi surface to ensure that arrows are not too close together. Only has an effect when used with thevector_properties
option.cmin (
float
|None
) – Minimum intensity for normalising properties colors (including vector colors). Only has an effect when used withcolor_properties
orvector_properties
options.cmax (
float
|None
) – Maximum intensity for normalising properties colors (including vector colors). Only has an effect when used withcolor_properties
orvector_properties
options.vnorm (
float
|None
) – The value by which to normalize the vector lengths. For example, spin properties should typically have a norm of 1 whereas group velocity properties can have larger or smaller norms depending on the structure. By changing this number, the size of the vectors will be scaled. Note that the properties of two materials can only be compared quantitatively if a fixed values is used for both plots. Only has an effect when used with thevector_properties
option.hide_slice (
bool
) – Whether to hide the Fermi surface. Only recommended in combination with thevector_properties
option.hide_labels (
bool
) – Whether to show the high-symmetry k-point labels.hide_cell (
bool
) – Whether to show the reciprocal cell boundary.plot_index (
list
[int
] |dict
[Spin
,list
[int
] |int
] |int
) –A choice of band indices (0-based). Valid options are:
A single integer, which will select that band index in both spin channels (if both spin channels are present).
A list of integers, which will select that set of bands from both spin channels (if both a present).
A dictionary of
{Spin.up: band_index_1, Spin.down: band_index_2}
, where band_index_1 and band_index_2 are either single integers (if one wishes to plot a single band for that particular spin) or a list of integers. Note that the choice of integer and list can be different for different spin channels.None
in which case all bands will be plotted.
arrow_pivot (
str
) – The part of the arrow that is anchored to the X, Y grid. The arrow rotates about this point, options are: tail, middle, tip.slice_kwargs (
dict
[str
,Any
] |None
) – Optional arguments that are passed toLineCollection
and are used to style the iso slice.cbar_kwargs (
dict
[str
,Any
] |None
) – Optional arguments that are passed tofig.colorbar
.quiver_kwargs (
dict
[str
,Any
] |None
) – Optional arguments that are passed toax.quiver
and are used to style the arrows.bz_kwargs (
dict
[str
,Any
] |None
) – Optional arguments that passed toLineCollection
and used to style the Brillouin zone boundary.sym_pt_kwargs (
dict
[str
,Any
] |None
) – Optional arguments that are passed toax.scatter
and are used to style the high-symmetry k-point symbols.sym_label_kwargs (
dict
[str
,Any
] |None
) – Optional arguments that are passed toax.text
and are used to style the high-symmetry k-point labels.
- Returns:
matplotlib pyplot object.