\(\newcommand{\AA}{\text{Å}}\)

CRYSTALpytools.plot module

Functions to visualize CRYSTAL outputs.

plot_ECHG(*echg, unit='Angstrom', output=[], option='both', levels=150, lineplot=False, linewidth=1.0, isovalues=None, colorplot=True, colormap='jet', cbar_label='default', a_range=[], b_range=[], rectangle=False, edgeplot=False, x_ticks=5, y_ticks=5, layout=None, title=None, figsize=[6.4, 4.8], sharex=True, sharey=True, fontsize=14, **kwargs)

Read and plot multiple 2D charge density files / objects. The uniform plot set-ups are used for comparison.

3 styles are available:

  1. lineplot=True and colorplot=True: The color-filled contour map

    with black contour lines. Dotted lines for negative values and solid lines for positive values. The solid line twice in width for 0.

  2. lineplot=False and colorplot=True: The color-filled contour map.

  3. lineplot=True and colorplot=False: The color coded contour line

    map. Blue dotted line for negative values and red solid lines for positive values. The balck solid line twice in width for 0.

Available options:

  • ‘both’If spin polarized, plot both charge and spin densities.

    Otherwise plot charge densities.

  • ‘charge’: Plot charge density.

  • ‘spin’: Plot spin density.

  • ‘diff’: Substracting charge data from the first entry with the following

    entries. Return to a non spin-polarized object.

Parameters:
  • *echg (electronics.ChargeDensity|str) – Extendable. File names or electronics.ChargeDensity objects.

  • unit (str) – Plot unit. ‘Angstrom’ for \(\AA^{-3}\), ‘a.u.’ for Bohr \(^{-3}\).

  • output (str|list[str]) – Output files corresponding to the input data file. String for the same output of all the files and list for every input file. If not given, read the first 1(2) MAPNET data of systems without (with) spin.

  • option (str) – Available options see above.

  • levels (int|array) – Set levels of contour plot. A number for linear scaled plot colors or an array for user-defined levels, must be consistent with ``unit``. 2*nLevel can be defined when option='both'.

  • lineplot (bool) – Plot contour lines.

  • linewidth (float) – Contour linewidth. Useful only if lineplot=True. Other properties are not editable. Solid black lines for positive values and 0, dotted for negative.

  • isovalues (str|None) – Add isovalues to contour lines and set their formats. Useful only if lineplot=True. None for not adding isovalues.

  • colorplot (bool) – Plot color-filled contour plots.

  • colormap (str) – Matplotlib colormap option. Useful only if colorplot=True.

  • cbar_label (str) – Label of colorbar. Useful only if colorplot=True. 1*2 list of colorbar titles can be set for spin-polarized systems. ‘None’ for no labels and ‘default’ for default label.

  • a_range (list) – 1*2 range of \(a\) axis (x, or BC) in fractional coordinate.

  • b_range (list) – 1*2 range of \(b\) axis (x, or AB) in fractional coordinate.

  • rectangle (bool) – If \(a, b\) are non-orthogonal, plot a rectangle region and reset \(b\). If used together with b_range, that refers to the old \(b\).

  • edgeplot (bool) – Whether to add cell edges represented by the original base vectors (not inflenced by a/b range or rectangle options).

  • x_ticks (int) – Number of ticks on x axis.

  • y_ticks (int) – Number of ticks on y axis.

  • layout (list|tuple) – The layout of subplots, [nrow, ncol]. Default is 2 cols per row.

  • title (str|None) – The title of the plot. ‘None’ for no title. The default subplot titles are used either way.

  • figsize (list) – Matplotlib figure size. Note that axes aspects are fixed to be equal.

  • sharex (bool) – Whether to share the x-axis among subplots.

  • sharey (bool) – Whether to share the y-axis among subplots.

  • fontsize (int) – Fontsize of the heightest level of title.

  • **kwargs – Other arguments passed to axes.contour() function to set contour lines. Applied to all the subplots.

Returns:

figs (list|Figure) – Matplotlib Figure object or a list of them.

plot_relativistics2D(*relat, unit='SI', type=[], output=[], direction=['x', 'y', 'z'], levels=100, quiverplot=True, quiverscale=1.0, colorplot=True, colormap='jet', cbar_label='default', a_range=[], b_range=[], rectangle=False, edgeplot=False, x_ticks=5, y_ticks=5, layout=None, title=None, figsize=[6.4, 4.8], sharex=True, sharey=True, fontsize=14, **kwargs)

Plot 2D vector field properties from relativistics (2c-SCF) calculations.

3 styles are available:

  1. quiverplot=True and colorplot=True: The color-filled contour

    illustrates the norm of vectors. The black arrows indicates both the directions and norms of in-plane prjections.

  2. quiverplot=True and colorplot=False: The arrows are colored to

    indicate the directions and norms of in-plane prjections.

  3. quiverplot=False and colorplot=True: The color-filled contour

    illustrates the norm of vectors, similar to the 2D scalar map.

Note

Not for charge density (relativistics.ChargeDensity). To visualize it, use plot_ECHG.

Parameters:
  • *relat (str|Magnetization|OrbitalCurrentDensity|SpinCurrentDensity|) – extendable input of vector field classes, or input files.

  • unit (str) – Plot unit. ‘SI’ for \(\AA\) and A/m (A/m \(^{2}\)). ‘a.u.’ for Bohr and a.u. magnetization / current density.

  • type (str|list[str]) – Properties to plot. Either as a string or a list of strings consistent with input filenames. If a list of types and a single file is given, read all the types from the input file. In other cases error would be given.

  • output (str|list[str]) – Output files corresponding to the input data file. String for the same output of all the files and list for every input file.

  • direction (list[str]|str) – Only for SpinCurrentDensity classes. Direction of spin-current to plot, in ‘x’, ‘y’ or ‘z’. Applied to all the SpinCurrentDensity objects.

  • levels (int|array) – Set levels of colored contour/quiver plot. A number for linear scaled plot colors or an array for user-defined levels. 1D.

  • quiverplot (bool) – Plot 2D field of arrows.

  • quiverscale (float) – Tune the length of arrows. Useful only if quiverplot=True.

  • colorplot (bool) – Plot color-filled contour plots.

  • colormap (str) – Matplotlib colormap option. Useful only if colorplot=True.

  • cbar_label (str|None) – Label of colorbar. ‘default’ for unit. ‘None’ for no label. Useful only if colorplot=True.

  • a_range (list) – 1*2 range of \(a\) axis (x, or BC) in fractional coordinate.

  • b_range (list) – 1*2 range of \(b\) axis (x, or AB) in fractional coordinate.

  • rectangle (bool) – If \(a, b\) are non-orthogonal, plot a rectangle region and reset \(b\). If used together with b_range, that refers to the old \(b\) (i.e., expansion first).

  • edgeplot (bool) – Whether to add cell edges represented by the original base vectors (not inflenced by a/b range or rectangle options).

  • x_ticks (int) – Number of ticks on x axis.

  • y_ticks (int) – Number of ticks on y axis.

  • layout (list|tuple) – The layout of subplots, [nrow, ncol]. Default is 2 cols per row.

  • title (str|None) – The title of the plot. ‘None’ for no title. The default subplot titles are used either way.

  • figsize (list) – Matplotlib figure size. Note that axes aspects are fixed to be equal.

  • sharex (bool) – Whether to share the x-axis among subplots.

  • sharey (bool) – Whether to share the y-axis among subplots.

  • fontsize (int) – Fontsize of the heightest level of title.

  • **kwargs – Other arguments passed to axes.quiver() function to set arrow styles. Applied to all the subplots.

  • Returns – fig (Figure): Matplotlib Figure class.

plot_electron_bands(*bands, unit='eV', k_label=[], mode='single', not_scaled=False, energy_range=[], k_range=[], band_label=None, band_color=None, band_linestyle=None, band_linewidth=None, fermi_level=0.0, fermi_color='tab:green', fermi_linestyle='-', fermi_linewidth=1.0, layout=None, title=None, figsize=[6.4, 4.8], legend='lower right', sharex=True, sharey=True, fontsize=14, **kwargs)

Plot electron band structures.

Parameters:
  • *bands (ElectronBand|str) – electronics.ElectronBand object or band structure files of the CRYSTAL properties excutable. Note that lattice information is not available if file names are specified.

  • unit (str) – The unit of energy. Can be ‘eV’ or ‘a.u.’.

  • k_label (list) – nSystem*nTick or 1*nTick list of strings of the label for high symmetry points along the path. If a 1D list is given, the same labels are used for all the systems. mathtext experssions can also be used as in matplotlib.

  • mode (str) – The plotting mode, ‘single’, ‘multi’ and ‘compare’.

  • not_scaled (bool) – Whether to scale the x-axis for different volumes. Useful with mode='compare'. The multi mode forces scaling.

  • energy_range (array) – A 2x1 array specifying the energy range.

  • k_range (array) – A 2x1 array specifying the k-range.

  • band_label (str|list) – Plot legend. If only one string is given, apply it to all plots. 1*nSystem or nSystem*2 (spin) plot legend otherwise. If spin>1 and 1*nSystem list is used, they are marked with the same label.

  • band_color (str|list) – Color of band structure. If only one string is given, apply it to all plots. For ‘single’ and ‘compare’ modes, also 1*2 color list for spin. For the ‘multi’ mode, 1*nSystem or nSystem*2 (spin) plot color. If spin>1 and spin dimension is not included, spin states are in the same color. ‘None’ for default values (‘tab:blue’ and other tab series).

  • band_linestyle (str|list) – Linestyle of band structure. If only one string is given, apply it to all plots. For ‘single’ and ‘compare’ also r 1*2 linestyle list for spin. For the ‘multi’ mode, 1*nSystem or nSystem*2 (spin) linestyle string. If spin>1 and spin dimension is not included, spin states are in the same style. ‘None’ for default values (‘-‘).

  • band_linewidth (str|list) – Linewidth of band structure. If only one number is given, apply it to all plots. For ‘single’ and ‘compare’ modes, also 1*2 linewidth list for spin. For the ‘multi’ mode, 1*nSystem or nSystem*2 (spin) linewidth numbers. If spin>1 and spin dimension is not included, spin states are in the same width. ‘None’ for default values (1.0).

  • fermi_level (float|list|None) – Fermi energy in the same unit as input band energy. By default the band is aligned to 0. Can be used to offset the band. None for not plotting Fermi. For ‘compare’ mode, different offsets can be used.

  • fermi_color (str) – Color of the Fermi level.

  • fermi_linestyle (str) – Line style of Fermi level.

  • fermi_linewidth (float) – Width of the Fermi level.

  • layout (list|tuple) – For ‘compare’ mode, the layout of subplots, [nrow, ncol]. The default is 2 cols per row.

  • title (str) – The title of the plot.

  • figsize (list) – The figure size specified as [width, height].

  • legend (str|None) – Loc parameter passed to axes.legend() None for not adding legend.

  • sharex (bool) – Whether to share the x-axis among subplots.

  • sharey (bool) – Whether to share the y-axis among subplots.

  • fontsize (int) – Fontsize of the highest level title and axis labels.

  • **kwargs – Other arguments passed to Axes.plot() of band plots.

Returns:

fig (Figure) – Matplotlib figure object

Raises:

ValueError – If the specified unit is unknown.

plot_electron_doss(*doss, unit='eV', beta='up', overlap=False, prj=[], energy_range=[], dos_range=[], dos_label=None, dos_color=None, dos_linestyle=None, dos_linewidth=None, fermi_level=0.0, fermi_color='tab:green', fermi_linestyle='-', fermi_linewidth=1.0, title=None, figsize=[6.4, 4.8], legend='lower right', sharex=True, sharey=False, fontsize=14, **kwargs)

Plot electron density of states.

Parameters:
  • *doss (ElectronDOS|str) – electronics.ElectronDOS object or DOSS files of the CRYSTAL properties excutable. Note that lattice information is not available if file names are specified.

  • unit (str) – ‘eV’ or ‘a.u.’

  • beta (str) – Plot settings for \(eta\) states (‘up’ or ‘down’).

  • overlap (bool) – Plotting multiple projections into the same figure. Useful only if a single entry of doss is plotted. Otherwise projections from the same entry will be overlapped into the same subplot.

  • prj (list) – Index of selected projections, consistent with the first dimension of the doss, starting from 1. Effective for all the subplots.

  • energy_range (list) – 1*2 list of energy range

  • dos_range (list) – 1*2 list of DOS range

  • dos_label (str|list) – Plot legend. If only one string is given, apply it to all plots. 1*nPrj or nPrj*2 (spin) plot legend otherwise. If spin>1 and 1*nSystem list is used, they are marked with the same label. Effective for all the subplots.

  • dos_color (str|list) – Color of DOSS plots. If only one string is given, apply it to all plots. 1*nPrj or nPrj*2 (spin) plot color. If spin>1 and spin dimension is not included, spin states are in the same color. ‘None’ for default values (matplotlib Tableau Palette for both spin-up and spin-down states). Effective for all the subplots.

  • dos_linestyle (str|list) – Linestyle of DOSS plot. If only one string is given, apply it to all plots. 1*nPrj or nPrj*2 (spin) line styles. If spin>1 and spin dimension is not included, spin states are in the same linestyle. ‘None’ for default values (‘-’ for spin-ups and ‘–’ for spin-downs). Effective for all the subplots.

  • dos_linewidth (str|list) – Linewidth of DOSS plot. If only one number is given, apply it to all plots. 1*nPrj or nPrj*2 (spin) line widthes. If spin>1 and spin dimension is not included, spin states are in the same linestyle. ‘None’ for default values (1.0). Effective for all the subplots.

  • fermi_level (float|list|None) – Fermi energy in the same unit as input doss energy. By default the doss is aligned to 0. Can be used to offset the doss. None for not plotting Fermi.

  • fermi_color (str) – Color of the Fermi level.

  • fermi_linestyle (str) – Line style of Fermi level.

  • fermi_linewidth (float) – Width of the Fermi level.

  • title (str) – The title of the plot.

  • figsize (list) – The figure size specified as [width, height].

  • legend (str|None) –

    Loc parameter passed to axes.legend() None for not adding legend.

  • sharex (bool) – Whether to share the x-axis among subplots.

  • sharey (bool) – Whether to share the y-axis among subplots.

  • fontsize (int) – Fontsize of the highest level title and axis labels.

  • **kwargs – Other arguments passed to Axes.plot() of band plots.

Returns:

fig (Figure) – Matplotlib figure object

plot_electron_banddos(*data, unit='eV', k_label=[], dos_beta='down', dos_overlap=True, dos_prj=[], energy_range=[], k_range=[], dos_range=[], band_width=2, band_label=None, band_color=None, band_linestyle=None, band_linewidth=None, dos_label=None, dos_color=None, dos_linestyle=None, dos_linewidth=None, fermi_level=0.0, fermi_color='tab:green', fermi_linestyle='-', fermi_linewidth=1.0, title=None, figsize=[6.4, 4.8], legend='lower right', fontsize=14, **kwargs)

Plot electron band structure + dos for a single system, i.e., the bands and doss variables are not extendable.

Input arguments not in the list are consistent with plot_electron_doss and plot_electron_bands.

Parameters:
  • *data – Either 1 or 2 entries. For one enetry, it is fort.25 containing both band and DOS, or ElectronBandDOS object. For 2 entries, the first entry is bands of plot_electron_bands and the second is doss of plot_electron_doss

  • dos_beta (str) – beta of plot_electron_doss.

  • dos_overlap (bool) – overlap of plot_electron_doss. The user can either plot projections into the same subplot or into separate subplots.

  • dos_prj (list) – prj of plot_electron_doss.

  • band_width (int|float) – Relative width of band structure, times of the width of a DOS subplot.

Returns:

fig (Figure) – Matplotlib figure object

Raises:

ValueError – If the unit parameter is unknown.

plot_topond2D(*topond, unit='Angstrom', type='infer', option='normal', levels='default', lineplot=True, linewidth=1.0, isovalues='%.4f', colorplot=False, colormap='jet', cbar_label='default', cpt_marker='o', cpt_color='k', cpt_size=10, traj_color='r', traj_linestyle=':', traj_linewidth=0.5, a_range=[], b_range=[], edgeplot=False, x_ticks=5, y_ticks=5, layout=None, title=None, figsize=[6.4, 4.8], sharex=True, sharey=True, fontsize=14)

Read and plot multiple TOPOND 2D plot files / objects. The uniform plot set-ups are used for comparison.

Note

For the convenience of analysis and plotting, it is important to select the correct type for your input file. By default type=’infer’ will search for (case insensitive) the following strings:

‘SURFRHOO’, ‘SURFSPDE’, ‘SURFLAPP’, ‘SURFLAPM’, ‘SURFGRHO’, ‘SURFKKIN’, ‘SURFGKIN’, ‘SURFVIRI’, ‘SURFELFB’, ‘TRAJGRAD’, ‘TRAJMOLG’

For their meanings, please refer the TOPOND manual.

Available options:

  • ‘normal’ : Literally normal.

  • ‘diff’Substract data from the first entry using following entries. All

    the entries must have the same type and must be ‘SURF*’ types.

  • ‘overlay’: Overlapping a ‘TRAJ*’ object on the 2D ‘SURF*’ object. Inputs

    must be 1*2 lists of a Surf object and a Traj object. File names are not permitted as geometry information is mandatory.

Note

2D periodicity (a_range and b_range), though available for the child classes of the topond.ScalarField class, is not suggested as TOPOND plotting window does not always commensurate with periodic boundary. The topond.Trajectory class has no 2D periodicity so if option='overlay', a_range, b_range and edgeplot will be disabled.

Note

The plot_lapm option is not available for Laplacian class. Use Laplacian().plot_2D().

Parameters:
  • *topond (electronics.ChargeDensity|SpinDensity|Gradient|Laplacian|HamiltonianKE|LagrangianKE|VirialField|ELF|GradientTraj|ChemicalGraph|list|str) – Extendable. File names, topond objects or 1*2 list for option='overlay'. Geometry information is not available if file names are used - might lead to errors!.

  • unit (str) – Plot unit. ‘Angstrom’ for \(\AA^{-3}\), ‘a.u.’ for Bohr \(^{-3}\).

  • type (str) – ‘infer’ or specified. Otherwise warning will be given.

  • option (str) – Available options see above.

  • levels (array|int) – Set levels of contour plot. ‘Default’ for built-in, property adaptive levels (unit='Angstrom'). Otherwise as array or int for linear scales. Entries must be consistent with ``unit``.

  • lineplot (bool) – Plot contour lines.

  • linewidth (float) – Contour linewidth. Useful only if lineplot=True. Other properties are not editable.

  • isovalues (str|None) – Add isovalues to contour lines and set their formats. Useful only if lineplot=True. None for not adding isovalues.

  • colorplot (bool) – Plot color-filled contour plots.

  • colormap (str) – Matplotlib colormap option. Useful only if colorplot=True.

  • cbar_label (str) – Label of colorbar. Useful only if colorplot=True. ‘None’ for default.

  • cpt_marker (str) – Marker of critical point scatter.

  • cpt_color (str) – Marker color of critical point scatter.

  • cpt_size (float|int) – Marker size of critical point scatter.

  • traj_color (str) – Line color of 2D trajectory plot.

  • traj_linestyl (str) – Line style of 2D trajectory plot.

  • traj_linewidth (str) – Line width of 2D trajectory plot.

  • a_range (list) – 1*2 range of \(a\) axis (x, or BC) in fractional coordinate. ‘Surf’ plots only.

  • b_range (list) – 1*2 range of \(b\) axis (x, or AB) in fractional coordinate. ‘Surf’ plots only.

  • edgeplot (bool) – Whether to add cell boundaries represented by the original base vectors (not inflenced by a/b range).

  • x_ticks (int) – Number of ticks on x axis.

  • y_ticks (int) – Number of ticks on y axis.

  • title (str|None) – The title of the plot. ‘None’ for no title. The default subplot titles are used either way.

  • figsize (list) – Matplotlib figure size. Note that axes aspects are fixed to be equal.

  • sharex (bool) – Whether to share the x-axis among subplots.

  • sharey (bool) – Whether to share the y-axis among subplots.

  • fontsize (int) – Fontsize of the heightest level of title.

Returns:

fig (Figure) – Matplotlib Figure object.

plot_cry_rholine(rholine_obj)

Plot the resistivity as a function of distance.

Parameters:
  • rholine_obj (object) – Rholine object containing the data for the resistivity.

  • save_to_file (bool, optional) – If True, saves the plot to a file. Default is False.

Returns:

None

Notes: - Plots the resistivity as a function of distance. - Sets the x-axis label as \AA and the y-axis label as \rho [\frac{e}{\AA^{3}]. - Saves the plot to a file named ‘figure_rholine_YYYY-MM-DD_HHMMSS.jpg’ in the current directory. - If save_to_file is True, saves the plot to a file specified by save_to_file parameter.

plot_cry_lapl_profile(lapl_obj)

Plot the Laplacian profile of a crystal.

Parameters:
  • lapl_obj (object) – Laplacian object containing the data for the Laplacian profile.

  • save_to_file (bool, optional) – Indicates whether to save the plot to a file. Defaults to False.

Returns:

None

Notes

  • Plots the Laplacian profile using the data from the Laplacian object.

  • The x-axis represents the distance in angstroms.

  • The y-axis represents the Laplacian in electrons per cubic angstrom to the fifth power (e/A^5).

  • The area under the curve where the Laplacian is negative is filled with a light blue color.

  • The area under the curve where the Laplacian is positive is filled with a light coral color.

  • If save_to_file is set to a file path, the plot is saved to that file.

plot_cry_density_profile(lapl_obj)

Plot the density profile of a crystal.

Parameters:
  • lapl_obj (object) – Laplacian object containing the data for the density profile.

  • save_to_file (bool, optional) – Indicates whether to save the plot to a file. Defaults to False.

Returns:

None

Notes

  • Plots the density profile using the data from the Laplacian object.

  • The x-axis represents the distance in angstroms.

  • The y-axis represents the density in electrons per cubic angstrom (e/A^3).

  • If save_to_file is set to a file path, the plot is saved to that file.

plot_transport_tensor(*boltztra, option='normal', x_axis='potential', x_range=[], direction='xx', spin='sum', plot_series=[], plot_label=None, plot_color=None, plot_linestyle=None, plot_linewidth=None, zero_color='tab:gray', zero_linestyle='-', zero_linewidth=1.0, layout=None, title=None, figsize=[6.4, 4.8], legend='upper left', sharey=True, fontsize=14, **kwargs)

Plot tensor-like transport properties in multiple ways:

  1. Normal: For 1 entry, same as transport.Tensor.plot(). Otherwise plot

    different transport properties of the same system. A massive plot in nRow*nCol is plotted and each subplot consists of nDir*1 subplots. The layout option only specifies the layout of property blocks, and the sharey option fixes the y axis scale of ‘sub-subplots’.

  2. Multi: Plot transport properties of different systems together for

    comparison. In this case direction does not accept list variables, and entries of plot_series will be plotted into subplots.

With list inputs the user can get thermoelectric power factor (\(S^{2}\sigma\)) or dimensionless figure of merit (\(ZT = \frac{S^{r}\sigma T}{\kappa}\)).

  • Power Factor: 1*2 list of any 2 in ‘SIGMA’, ‘SIGMAS’ and ‘SEEBECK’.

  • ZT: 1*3 list of 1 ‘KAPPA’ and any 2 in ‘SIGMA’, ‘SIGMAS’ and ‘SEEBECK’.

Note

Make sure all the entries are from the same calculation when using ‘power factor’ or ‘zt’ options. The code only checks the dimensionalities of tensors.

X-axis options:

  1. X_axis: Chemical potential \(\mu\); Plot series: Temperature \(T\).

  2. X_axis: Carrier density \(\rho(\mu; T)\); Plot series: Temperature \(T\).

  3. X_axis: Temperature \(T\); Plot series: Chemical potential \(\mu\).

Parameters:
  • *boltztra (str|Tensor) – DAT’ files by CRYSTAL BOLTZTRA keyword or the transport.Tensor objects.

  • option (str) – ‘power factor’, ‘zt’ and ‘multi’. See above.

  • x_axis (str) – X axis options, ‘potential’, ‘carrier’ or ‘temperature’. See above.

  • x_range (list) – Display range of x axis. Y axis is self-adaptive.

  • direction (str|list) – Depending on the dimensionality of the system, including ‘xx’, ‘xy’, ‘xz’, ‘yx’, ‘yy’, ‘yz’, ‘zx’, ‘zy’ and ‘zz’. A list of options will generate nDirect*1 subplots. The direction of each subplot is annotated on the upper left corner. List entry is not allowed for ``option=’multi’``.

  • spin (str) – Spin-polarized systems only. Electron spins to plot. ‘up’, ‘down’ or ‘sum’. Disabled for option='spin'.

  • plot_series (list|array|float) – Values of the plot series. Should be commensurate with the choice of x_axis. It will be annotated on the upper right corner for option='multi'.

  • plot_label (list|str|None) – None for default values: plot_series and its unit, or sequence number of materials for option='multi'. If str, prefixing that entry in front of the default value. If list, it should be 1*nPlotSeries, or 1*nBoltztra for option='multi', for every plot line.

  • plot_color (list|str|None) – Similar to electronics.ElectronDOS.plot(). If str, use the same color for all the plot lines. If 1*nPlotSeries(nBoltztra), use the same color for every plot line. If 2*nPlotSeries(nBoltztra), use different colors for p-type and n-type carrier properties.

  • plot_linestyle (list|str|None) – Similar to electronics.ElectronDOS.plot(). See explanations of plot_color.

  • plot_linewidth (list|float|None) – Similar to electronics.ElectronDOS.plot(). See explanations of plot_color.

  • zero_color (str) – Color of the 0 value line.

  • zero_linestyle (str) – Linestyle of the 0 value line.

  • zero_linewidth (float) – Linewidth of the 0 value line.

  • layout (list[int]) – Layout of subplots. By default it is nDirection*1 or nPlot_series*1 gird of figures.

  • title (str) – Title

  • figsize (list) – Figure size.

  • legend (str|None) – Location of legend. None for not adding legend.

  • sharey (bool) – Share y axis for multiple subplots. Share x is enforced.

  • fontsize (float|int) – Font size of the title, subplot capations (direction), x and y axis capations.

  • **kwargs – Other arguments passed to the matplotlib Axes.plot() method. Applied to all the plots.

Returns:

fig (Figure) – Matplotlib Figure object.

plot_elastics3D(*tensor, property, uniform_scale=True, nphi=90, ntheta=90, nchi=180, scale_radius=True, range_cbar=None, range_x=None, range_y=None, range_z=None, u=None, utext=None, use_cartesian=True, plot_lattice=False, colormap='jet', layout=None, title=None, figsize=[6.4, 4.8], fontsize=14, **kwargs)

A wrapper function of Tensor3D objects to plot 3D crystal elastic properties. The user can plot multiple properties for different systems. The function returns to a matplotlib figure object for further processing. The uniform plot set-ups are used for comparison. Only matplotlib is used for plotting. Plotly is not available.

Properties:

  • “young”: Young’s modulus.

  • “comp”: Compressibility.

  • “shear avg”: Average shear modulus.

  • “shear min”: Minimum shear modulus.

  • “shear max”: Maximum shear modulus.

  • “poisson avg”: Average Poisson ratio.

  • “poisson min”: Minimum Poisson ratio.

  • “poisson max”: Maximum Poisson ratio.

Parameters:
  • *tensor (str | Tensor3D | numpy.ndarray) – Elastic tensor definition. Can be CRYSTAL output files, Tensor3D objects and 6*6 elastic matrices in Voigt notation, GPa. For files, conventional_lattice=True.

  • property (str | list[str]) – The properties to plot. See above.

  • uniform_scale (bool) – Use the same color scale for all plots of the same property.

  • nphi (int) – Resolution of azimuth angle \(\phi\) on xy plane, in radian \([0, 2\pi)\).

  • ntheta (int) – Resolution of polar angle \(\theta\) in radian \([0, 2\pi)\). In practice only half of the points defined in \([0, \pi)\) are used.

  • nchi (int) – Resolution of auxiliary angle \(\chi\), in radian \([0, 2\pi)\). Shear modulus and Poisson ratio only.

  • scale_radius (bool) – To scale the radius by values of the elastic property, or plot a sphere with radius = 1.

  • range_cbar (list[float,float]) – Not suggested Explicitly specifying the ranges of colorbar, x, y and z axes.

  • range_x (list[float,float]) – Not suggested Explicitly specifying the ranges of colorbar, x, y and z axes.

  • range_y (list[float,float]) – Not suggested Explicitly specifying the ranges of colorbar, x, y and z axes.

  • range_z (list[float,float]) – Not suggested Explicitly specifying the ranges of colorbar, x, y and z axes.

  • u (numpy.ndarray) – 3*1 or nu*3 array of vectors to be added into the figure. A line segment with doubled radius is plotted to indicate the vector. Or ‘max’ / ‘min’ / ‘bothends’, plot vectors corresponding to the max and min of elastic properties. For ‘bothends’, min first.

  • utext (list[str] | str) – A string or a list of string. Used to mark the vector. If None, the input u and the corresponding value is annotated. If ‘value’, the value is annotated.

  • use_cartesian (bool) – Vector is defined as cartesian or fractional coordinates. (Only when lattice information is available.)

  • plot_lattice (bool) – Draw the lattice box around the 3D surface.

  • colormap (str) – Colormap name.

  • layout (list|tuple) – The layout of subplots, [nrow, ncol]. Default is nTensor*nProperty or 1*nTensor.

  • title (str|None) – The title of the plot. ‘None’ for no title. The default subplot titles (property) are added either way.

  • figsize (list) – Matplotlib figure size.

  • fontsize (int) – Fontsize of the heightest level of title.

  • **kwargs – Parameters passed to Axes3D.view_init. Only camera position keywords are suggested.

Returns:

fig (Figure) – Matplotlib figure object.

plot_elastics2D(*tensor, property, plane=[], ntheta=90, nchi=180, plane_definition='miller', u=None, utext=None, use_cartesian=True, plot_lattice=True, loop_label=None, loop_color=None, loop_linestyle=None, loop_linewidth=None, layout=None, title=None, figsize=[6.4, 4.8], legend='upper left', fontsize=14, **kwargs)

A wrapper function of Tensor3D or Tensor2D objects to plot 2D crystal elastic properties. The user can plot multiple properties on multiple crystal planes (3D only) for multiple systems. The function returns to a matplotlib figure object for further processing. The uniform plot set-ups (radius) are used for comparison. Base units: GPa, m.

Properties, depending on the dimensionality of systems:

  • “young”: Young’s modulus.

  • “comp”: Compressibility.

  • “shear”: Shear modulus between vectors in plane and plane norm (3D) or in-plane vectors (2D).

  • “shear avg”: Average shear modulus (3D).

  • “shear min”: Minimum shear modulus (3D).

  • “shear max”: Maximum shear modulus (3D).

  • “poisson”: Poisson ratio between vectors in plane and plane norm or in-plane vectors (2D).

  • “poisson avg”: Average Poisson ratio (3D).

  • “poisson min”: Minimum Poisson ratio (3D).

  • “poisson max”: Maximum Poisson ratio (3D).

For 3D systems, the plotting planes have to be defined with any of the following methods:

  • ‘miller’: Miller indices.

  • ‘cartesian’: The plane normal vector in Cartesian coordinates.

  • ‘fractional’: The plane normal vector in fractional coordinates.

The default layout is either 1*nProp or nProp*nPlane. For multi-system plottings, the properties on the same plane are plotted into the same axis for comparison. The radius is ‘uniform’ for the same property, i.e., same raidus for plots on various materials and planes.

Note

For multi-system plotting, the loop_* inputs do not change with the plotting planes, but with systems in order to distinguish them. Therefore they should be defined by 1*nTensor list. In this case, loop_label is used. Otherwise it is not called.

For multi-system plotting, u and utext options are disabled.

Parameters:
  • *tensor (str|Tensor3D|numpy.ndarray) – Elastic tensor definition. Can be CRYSTAL output files, Tensor3D / Tensor2D``objects and 6\*6 / 3\*3 **elastic** matrices in Voigt notation, GPa. But dimensionalities of systems must be consistent. For 3D files, ``conventional_lattice=True.

  • property (str | list[str]) – The properties to plot. See above.

  • plane (numpy.ndarray) – 3D only 3*1 or nplane*3 array of planes.

  • ntheta (int) – Resolution of azimuth angle \(\theta\) on plane, in radian \([0, 2\pi)\).

  • nchi (int) – 3D only Resolution of auxiliary angle \(\chi\), in radian \([0, 2\pi)\). Shear modulus and Poisson ratio only.

  • plane_definition (str) – 3D only The method used to define the plane. See options above.

  • u (numpy.ndarray) – nDimen*1 or nu*nDimen array of vectors to be added into the figure. A line segment with doubled radius is plotted to indicate the vector. Or ‘max’ / ‘min’ / ‘bothends’, plot vectors corresponding to the max and min of elastic properties. For ‘bothends’, min first.

  • utext (list[str] | str) – A string or a list of string. Used to mark The vector. If None or ‘value’, the value is annotated.

  • use_cartesian (bool) – Vector is defined as cartesian or fractional coordinates. (Only when lattice information is available.)

  • plot_lattice (bool) – Draw lattice base vectors to indicate orientation of the plane.

  • loop_label (str|list) – Multi-tensor only Label of loops. None for default values: sequence number of materials If str, prefixing that entry in front of the default value. If list, it should be in 1*nTensor.

  • loop_color (str|list) – Color of 2D loops. If only one string is given, apply it to all loops. ‘None’ for default values (matplotlib Tableau Palette).

  • loop_linestyle (str|list) – Linestyle of 2D loops. If only one string is given, apply it to all plots. ‘None’ for default values (‘-‘).

  • loop_linewidth (str|list) – Linewidth of band structure. If only one number is given, apply it to all plots. For the ‘multi’ mode, 1*nSystem list of linewidth numbers. ‘None’ for default values (1.0).

  • layout (list|tuple) – 2D only 2*1 list. The layout of subplots. The first element is nrows, the second is ncolumns. By default, 1*nProp.

  • title (str) – Title

  • figsize (list) – The figure size specified as [width, height].

  • legend (str|None) – Multi-tensor only Location of legend. None for not adding legend.

  • fontsize (float|int) – Font size of the title.

  • **kwargs – Parameters passed to PolarAxes.plot to customize the loops. Applied to all the loops.

Returns:

fig (Figure) – Matplotlib figure object.

plot_phonon_bands(*bands, unit='cm-1', q_overlap_tol=0.0001, k_label=None, mode='single', not_scaled=False, frequency_range=[], k_range=[], band_label=None, band_color=None, band_linestyle=None, band_linewidth=None, plot_freq0=True, freq0_color='tab:gray', freq0_linestyle='-', freq0_linewidth=1.0, layout=None, title=None, figsize=[6.4, 4.8], legend='lower right', sharex=True, sharey=True, fontsize=14, **kwargs)

Plot phonon band structures.

Parameters:
  • *bands (PhononBand|str) – phonons.PhononBand object or the standard screen output (.out) files of CRYSTAL.

  • unit (str) – The unit of frequency. Can be ‘cm-1’ or ‘THz’.

  • q_overlap_tol (float) – The threshold for overlapped k points. Only used for getting tick positions. For filename input only.

  • k_label (list) –

    nSystem*nTick or 1*nTick list of strings of the label for high symmetry points along the path. If a 1D list is given, the same labels are used for all the systems. mathtext experssions can also be used as in matplotlib.

  • mode (str) – The plotting mode, ‘single’, ‘multi’ and ‘compare’.

  • not_scaled (bool) – Whether to scale the x-axis for different volumes. Useful with mode='compare'. The multi mode forces scaling.

  • frequency_range (array) – A 2x1 array specifying the frequency range.

  • k_range (array) – A 2x1 array specifying the k-range.

  • band_label (str|list) – Plot legend. If only one string is given, apply it to all plots. 1*nSystem plot legend otherwise.

  • band_color (str|list) – Color of band structure. If only one string is given, apply it to all plots. For the ‘multi’ mode, 1*nSystem list of plot colors. ‘None’ for default values (matplotlib Tableau Palette).

  • band_linestyle (str|list) – Linestyle of band structure. If only one string is given, apply it to all plots. For the ‘multi’ mode, 1*nSystem list of linestyle strings. ‘None’ for default values (‘-‘).

  • band_linewidth (str|list) – Linewidth of band structure. If only one number is given, apply it to all plots. For the ‘multi’ mode, 1*nSystem list of linewidth numbers. ‘None’ for default values (1.0).

  • plot_freq0 (bool) – Whether to plot 0 frequency line.

  • freq0_color (str) – Color of the 0 frequency line.

  • freq0_linestyle (str) – Line style of 0 frequency line.

  • freq0_linewidth (float) – Width of the 0 frequency line.

  • layout (list|tuple) – For ‘compare’ mode, the layout of subplots, [nrow, ncol]. The default is 2 cols per row.

  • title (str) – The title of the plot.

  • figsize (list) – The figure size specified as [width, height].

  • legend (str|None) –

    Loc parameter passed to axes.legend() None for not adding legend.

  • sharex (bool) – Whether to share the x-axis among subplots.

  • sharey (bool) – Whether to share the y-axis among subplots.

  • fontsize (int) – Fontsize of the highest level title and axis labels.

  • **kwargs – Other arguments passed to Axes.plot() of band plots.

Returns:

fig (Figure) – Matplotlib figure object

Raises:

ValueError – If the specified unit is unknown.

plot_phonon_doss(*doss, unit='cm-1', read_INS=False, atom_prj=[], element_prj=[], overlap=False, prj=[], gauss=0.0, frequency_range=[], dos_range=[], dos_label=None, dos_color=None, dos_linestyle=None, dos_linewidth=None, plot_freq0=True, freq0_color='tab:gray', freq0_linestyle='-', freq0_linewidth=1.0, title=None, figsize=[6.4, 4.8], legend='lower right', sharex=True, sharey=False, fontsize=14, **kwargs)

Plot phonon density of states.

Parameters:
  • *doss (PhononDOS|str) – phonon.PhononDOS object or the standard screen output (.out) files of CRYSTAL.

  • unit (str) – The unit of frequency. Can be ‘cm-1’ or ‘THz’.

  • read_INS (bool) – Read the inelastic neutron scattering spectra. For filename input only.

  • atom_prj (list) – Read the projections of atoms with specified labels. For filename input only.

  • element_prj (list) – Read projections of elements with specified conventional atomic numbers. For filename input only.

  • overlap (bool) – Plotting multiple projections into the same figure. Useful only if a single entry of doss is plotted. Otherwise projections from the same entry will be overlapped into the same subplot.

  • prj (list) – Index of selected projections, consistent with the first dimension of the doss, starting from 1. Effective for all the subplots.

  • gauss (float) – The standard deviation of Gaussian broadening, i.e. the \(\sigma\) of \(a\exp{\frac{(x-b)^{2}}{2\sigma^{2}}}\). ‘0’ for no Gaussian broadening. The length of data will be tripled. Valid only for data on the plot. Data saved in object is unchanged.

  • frequency_range (list) – 1*2 list of frequency range

  • dos_range (list) – 1*2 list of DOS range

  • dos_label (str|list) – Plot legend. If only one string is given, apply it to all plots. 1*nPrj plot legend otherwise. Effective for all the subplots.

  • dos_color (str|list) – Color of DOSS plots. If only one string is given, apply it to all plots. When overlap=True, 1*nPrj list of plot color. ‘None’ for default values (matplotlib Tableau Palette). Effective for all the subplots.

  • dos_linestyle (str|list) – Linestyle of DOSS plot. If only one string is given, apply it to all plots. When overlap=True, 1*nPrj list of line styles. ‘None’ for default values (‘-‘). Effective for all the subplots.

  • dos_linewidth (str|list) – Linewidth of DOSS plot. If only one number is given, apply it to all plots. When overlap=True, 1*nPrj list of line widthes. ‘None’ for default values (1.0). Effective for all the subplots.

  • plot_freq0 (bool) – Whether to plot 0 frequency line.

  • freq0_color (str) – Color of the 0 frequency line.

  • freq0_linestyle (str) – Line style of the 0 frequency line.

  • freq0_linewidth (float) – Width of the 0 frequency line.

  • title (str) – The title of the plot.

  • figsize (list) – The figure size specified as [width, height].

  • legend (str|None) –

    Loc parameter passed to axes.legend() None for not adding legend.

  • sharex (bool) – Whether to share the x-axis among subplots.

  • sharey (bool) – Whether to share the y-axis among subplots.

  • fontsize (int) – Fontsize of the highest level title and axis labels.

  • **kwargs – Other arguments passed to Axes.plot() of band plots.

Returns:

fig (Figure) – Matplotlib figure object

plot_phonon_banddos(*data, unit='cm-1', q_overlap_tol=0.0001, read_INS=False, atom_prj=[], element_prj=[], k_label=[], dos_overlap=True, dos_prj=[], dos_gauss=0.0, frequency_range=[], k_range=[], dos_range=[], band_width=2, band_label=None, band_color=None, band_linestyle=None, band_linewidth=None, dos_label=None, dos_color=None, dos_linestyle=None, dos_linewidth=None, plot_freq0=True, freq0_color='tab:green', freq0_linestyle='-', freq0_linewidth=1.0, title=None, figsize=[6.4, 4.8], legend='lower right', fontsize=14, **kwargs)

Plot phonon band structure + dos for a single system, i.e., the bands and doss variables are not extendable.

Input arguments not in the list are consistent with plot_phonon_doss and plot_phonon_bands.

Parameters:
  • *data – Either 1 or 2 entries. For one enetry, it is the standard screen output (.out) file with both band and DOS, or PhononBandDOS object. For 2 entries, the first entry is bands of plot_phonon_bands and the second is doss of plot_phonon_doss.

  • dos_overlap (bool) – overlap of plot_phonon_doss. The user can either plot projections into the same subplot or into separate subplots.

  • dos_prj (list) – prj of plot_phonon_doss.

  • dos_gauss (float) – gauss of plot_phonon_doss.

  • band_width (int|float) – Relative width of band structure, times of the width of a DOS subplot.

Returns:

fig (Figure) – Matplotlib figure object

Raises:

ValueError – If the unit parameter is unknown.

plot_XRD(*xrd, option='LP', shift=10, label=None, color=None, linestyle=None, linewidth=None, theta_range=[], title=None, figsize=[6.4, 4.8], legend='upper left', fontsize=14, **kwargs)

Plot the XRD spectra of multiple systems into the same plot axes.

Note

The highest intensity is normalized to 100.

Parameters:
  • xrd (str|XRD) – File name or spectra.XRD objects. Extendable.

  • option (str) – File name inputs only ‘NC’ for no correction (The ‘INTENS’ col); ‘LD’ for Lorentz and polarization effects (‘INTENS-LP’) and ‘DW’ for LD with Debye-Waller thermal factors (‘INTENS-LP-DW’).

  • shift (float) – If multiple spectra are plotted, shifting them up by the given value. Shift length is the value after normalization.

  • label (list|str|None) – List of plot labels. ‘None’ for the default values (’# <number>’) and string for prefix the string before number. Otherwise should be a 1*nXRD list.

  • color (list|str|None) – If str, use the same color for all the plot lines. If 1*nXRD, use the color defined for every plot line. ‘None’ for default values (matplotlib Tableau Palette).

  • linestyle (list|str|None) – See explanations of color.

  • linewidth (list|float|None) – See explanations of color.

  • theta_range (list) – 1*2 list of theta range in degree.

  • title (str|None) – The title of the plot. ‘None’ for no title.

  • figsize (list) – Matplotlib figure size.

  • legend (str|None) – Location of legend. None for not adding legend.

  • fontsize (int) – Fontsize of the axis label and title.

  • **kwargs – Other parameters passed to matplotlib Axes.plot() method.

Returns:

fig (Figure) – Matplotlib figure.

plot_IR(*ir, unit='cm-1', option='LG', shift=0, label=None, color=None, linestyle=None, linewidth=None, x_range=[], title=None, figsize=[6.4, 4.8], legend='upper left', sharey=True, fontsize=14, **kwargs)

Plot the IR spectra of multiple systems into the same plot axes. For reflectance spectra, nDirection*1 plots are generated. All the input files must have the same symmetry.

Note

The highest intensity is normalized to 100.

Parameters:
  • ir (str|IR) – IRSPEC.DAT file name or spectra.IR objects. Extendable.

  • option (str) – Broadening method. ‘LG’ for Lorentzian-Gaussian, ‘V’ for Voigt, ‘RS’ for Rayleigh spherical particles, ‘RE’ for Rayleigh with elipsoid particles, ‘REFL’ for reflectance spectra with ‘LG’. Periodic systems only.

  • shift (float) – If multiple spectra are plotted, shifting them up by the given value. Shift length is the value after normalization.

  • label (list|str|None) – List of plot labels. ‘None’ for the default values (’# <number>’) and string for prefix the string before number. Otherwise should be a 1*nIR list.

  • color (list|str|None) – If str, use the same color for all the plot lines. If 1*nIR, use the color defined for every plot line. ‘None’ for default values (matplotlib Tableau Palette).

  • linestyle (list|str|None) – See explanations of color.

  • linewidth (list|float|None) – See explanations of color.

  • x_range (list) – 1*2 list of x axis range.

  • title (str|None) – The title of the plot. ‘None’ for no title.

  • figsize (list) – Matplotlib figure size.

  • legend (str|None) – Location of legend. None for not adding legend.

  • sharey (bool) – Whether to share the y-axis among subplots. Share x is enforced.

  • fontsize (int) – Fontsize of the axis label and title.

  • **kwargs – Other parameters passed to matplotlib Axes.plot() method.

Returns:

fig (Figure) – Matplotlib figure.

plot_Raman(*raman, option='poly', overlap=True, direction=['xx', 'xy', 'xz', 'yy', 'yz', 'zz'], shift=0, label=None, color=None, linestyle=None, linewidth=None, x_range=[], title=None, figsize=[6.4, 4.8], legend='upper left', sharey=True, fontsize=14, **kwargs)

Plot the Raman spectra of multiple systems into the same plot axes.

Available options:

  • ‘tot’: Plot total raman spectra only. Plots with a single panel is generated.

  • ‘poly’: Plot total, parallel and perpendicular spectra into 3 subplots.

  • ‘single’: Plot single crystal spectra of specified directions into subplots.

Note

The highest intensity is normalized to 100.

Parameters:
  • raman (str|Raman) – RAMSPEC.DAT file name or spectra.Raman objects. Extendable.

  • option (str) – ‘tot’, ‘poly’ or ‘single’, see above.

  • overlap (bool) – If more than 1 inequivalent directions exists, whether to plot spectra into the same plot or into subplots.

  • direction (list|str) – ``option=’single’`` only Specify the directions of single crystal spectra to plot.

  • shift (float) – If multiple spectra are plotted, shifting them up by the given value. Shift length is the value after normalization.

  • label (list|str|None) – List of plot labels. ‘None’ for the default values (’# <number>’) and string for prefix the string before number. Otherwise should be a 1*nRaman list.

  • color (list|str|None) – If str, use the same color for all the plot lines. If 1*nRaman, use the color defined for every plot line. ‘None’ for default values (matplotlib Tableau Palette).

  • linestyle (list|str|None) – See explanations of color.

  • linewidth (list|float|None) – See explanations of color.

  • x_range (list) – 1*2 list of x axis range.

  • title (str|None) – The title of the plot. ‘None’ for no title.

  • figsize (list) – Matplotlib figure size.

  • legend (str|None) – Location of legend. None for not adding legend.

  • sharey (bool) – Whether to share the y-axis among subplots. Share x is enforced.

  • fontsize (int) – Fontsize of the axis label and title.

  • **kwargs – Other parameters passed to matplotlib Axes.plot() method.

Returns:

fig (Figure) – Matplotlib figure.

plot_cry_spec(transitions, typeS, components=False, bwidth=5, stdev=3, eta=0.5, fmin=None, fmax=None, ylim=None, savefig=False, dpi=300, filetype='png', exp_spec=None, sep=';', show=True, export_csv=False, label=None, xlabel='Wavenumber [cm$^{-1}$]', ylabel='Intensity [arb. u.]', linewidth=2.0, padd=100, fontsize=12, style=None, compstyle=None, nopadding=False, figsize=(16, 6))

Note

This is not for the released feature of CRYSTAL23 v1.0.1

This function enables the simulation of vibrational spectra based on a 2D NumPy array containing a list of transition frequencies and the corresponding intensities. The code allows users to model spectral broadening according to various profiles (Gaussian, Lorentzian, pseudo-Voigt), or zero broadening (Dirac deltas-like lines). Please, note that by turning the optional argument ‘component’ to True you can additionally plot contributions arising from each transition.

Parameters:
  • transitions (float|numpy.ndarray) – Array containing transition frequencies

  • intensities ((axis=0) and corresponding)

  • typeS (str) – String specifying the spectral profile: ‘bars’,

  • 'lorentz'

  • 'gauss'

  • 'pvoigt'.

  • components (bool, optional) – Whether to plot contributions arising from

  • transition (each)

  • bwidth (float, optional) – Half-width at half-maximum of the Lorentzian

  • profile (default is 0.5)

  • stdev (float, optional) – Standard deviation of the Gaussian profile

  • 5). ((default is)

  • eta (float, optional) – Fraction of Lorentzian character in pseudo-Voigt

  • profile

  • fmin (float, optional) – Minimum frequency.

  • fmax (float, optional) – Maximum frequency.

  • ylim (float, optional) – Maximum intensity.

  • savefig (bool, optional) – Whether to save the figure (default is False).

  • dpi (float, optional) – Dots per inches (default is 300).

  • filetype (str, optional) – File extension (default is ‘png’).

  • show (bool, optional) – Whether to show the figure (default is True).

  • export_csv (bool, optional) – Whether to save plot in csv format (default is

  • False).

  • xlabel (str, optional) – x-axis label (default is ‘Wavenumber [cm$^{-1}$]’).

  • ylabel (str, optional) – y-axis label (default is ‘Intensity [arb. u.]’).

  • linewidth (float) – Linewidth (default is 2.0).

  • padd (float, optional) – left- and right- hand side padding expressed in the

  • x-axis (same unit of the quantity reported in)

  • fontsize (integer, optional) – Fontsize (default is 12).

  • style (str, optional) – String specifying Matplotlib style.

  • compstyle (str|list, optional) – List containing Matplotlib styles to plot

  • component. (each)

  • nopadding (bool, optional) – Whether to remove padding (default is False).

  • figsize (real|list, optional) – List of two numbers specifying the aspect

  • figure (ratio of the)

Returns:

None

plot_cry_spec_multi(files, typeS, components=False, bwidth=5, stdev=3, eta=0.5, fmin=None, fmax=None, ylim=None, savefig=False, dpi=300, filetype='png', label=None, xlabel='Wavenumber [cm$^{-1}$]', ylabel='Instensity [arb. u.]', linewidth=2.0, padd=100, fontsize=12, style=None, nopadding=False, figsize=(16, 6))

Note

This is not for the released feature of CRYSTAL23 v1.0.1

This function is a wrapper for plot_spec function, enablng the simulation of many vibrational spectra coming from a list of NumPy array.

Parameters:
  • transitions (float|numpy.ndarray) – Array containing transition frequencies

  • intensities ((axis=0) and corresponding)

  • typeS (str) – String specifying the spectral profile: ‘bars’,

  • 'lorentz'

  • 'gauss'

  • 'pvoigt'.

  • components (bool, optional) – Whether to plot contributions arising from

  • transition (each)

  • bwidth (float, optional) – Half-width at half-maximum of the Lorentzian

  • profile (default is 0.5)

  • stdev (float, optional) – Standard deviation of the Gaussian profile

  • 5). ((default is)

  • eta (float, optional) – Fraction of Lorentzian character in pseudo-Voigt

  • profile

  • fmin (float, optional) – Minimum frequency.

  • fmax (float, optional) – Maximum frequency.

  • ylim (float, optional) – Maximum intensity.

  • savefig (bool, optional) – Whether to save the figure (default is False).

  • dpi (float, optional) – Dots per inches (default is 300).

  • filetype (str, optional) – File extension (default is ‘png’).

  • xlabel (str, optional) – x-axis label (default is ‘Wavenumber [cm$^{-1}$]’).

  • ylabel (str, optional) – y-axis label (default is ‘Intensity [arb. u.]’).

  • linewidth (float) – Linewidth (default is 2.0).

  • padd (float, optional) – left- and right- hand side padding expressed in the

  • x-axis (same unit of the quantity reported in)

  • fontsize (integer, optional) – Fontsize (default is 12).

  • style (str, optional) – String specifying Matplotlib style.

  • nopadding (bool, optional) – Whether to remove padding (default is False).

  • figsize (real|list, optional) – List of two numbers specifying the aspect

  • figure (ratio of the)

Returns:

None

plot_cry_xrd(xrd_obj)

Deprecated. Use plot_XRD.

plot_cry_irspec(irspec, x_unit='cm-1', y_mode='LG', figsize=None, linestyle='-', linewidth=1.5, color='tab:blue', freq_range=None, int_range=None, label=None)

Deprecated. Use plot_IR.

plot_cry_ramspec(ramspec, y_mode='total', figsize=None, linestyle='-', linewidth=1.5, color='tab:blue', freq_range=None, int_range=None, label=None)

Deprecated. Use plot_Raman.

plot_cry_ela(choose, ndeg, *args, dpi=200, filetype='.png', transparency=False)

Deprecated. Use plot_elastics3D.

plot_vecfield2D_m(header, dens, quivscale, name='MAG', levels=150, dpi=400)

Deprecated and incompatible with new functions. Give error.

plot_vecfield2D_j(header, dens, quivscale, name='SC', levels=150, dpi=400)

Deprecated and incompatible with new functions. Give error.

plot_vecfield2D_J(header, dens_JX, dens_JY, dens_JZ, quivscale, name='SCD', levels=150, dpi=400)

Deprecated and incompatible with new functions. Give error.

plot_electron_band(bands, unit='eV', k_labels=None, mode='single', not_scaled=False, energy_range=None, k_range=None, color='blue', labels=None, linestl='-', linewidth=1, fermi='forestgreen', fermiwidth=1.5, fermialpha=1, title=None, figsize=None, scheme=None, sharex=True, sharey=True, fontsize=12)

Deprecated. Use plot_electron_bands.

plot_cry_band(bands, k_labels=[], energy_range=[], title=None, not_scaled=True, mode='single', linestl='-', linewidth=1, color='blue', fermi='forestgreen', k_range=[], labels=None, figsize=[6.4, 4.8], scheme=None, sharex=True, sharey=True, fermiwidth=1.5, fermialpha=1, fontsize=12)

Deprecated. Use plot_electron_bands.

plot_electron_dos(doss, unit='eV', beta='up', overlap=False, prj=None, energy_range=None, dos_range=None, color='blue', labels=None, linestl=None, linewidth=1, fermi='forestgreen', title=None, figsize=None)

Deprecated. Use plot_electron_doss.

plot_cry_doss(doss, color='blue', fermi='forestgreen', overlap=False, labels=None, figsize=[6.4, 4.8], linestl=None, linewidth=1.0, title=None, beta='down', energy_range=[], dos_range=[], prj=[])

Deprecated. Use plot_electron_doss.

plot_cry_es(bands, doss, k_labels=[], color_bd='blue', color_doss='blue', fermi='forestgreen', energy_range=[], linestl_bd=None, linestl_doss=None, linewidth=1.0, prj=[], figsize=[6.4, 4.8], labels=None, dos_range=[], title=None, dos_beta='down')

Deprecated. Use plot_electron_doss.

plot_dens_ECHG(obj_echg, unit='Angstrom', xticks=5, yticks=5, cmap_max=None, cmap_min=None)

Deprecated. Use plot_ECHG.

plot_spin_ECHG(obj_echg, unit='Angstrom', levels=150, xticks=5, yticks=5, cmap_max=None, cmap_min=None)

Deprecated. Use plot_ECHG.

plot_cry_contour(contour_obj)

Deprecated. Use plot_topond2D.

plot_cry_contour_differences(contour_obj, contour_obj_ref)

Deprecated. Use plot_topond2D.

plot_cry_seebeck_potential(seebeck_obj)

Deprecated. Use plot_transport_tensor.

plot_cry_seebeck_carrier(seebeck_obj)

Deprecated. Use plot_transport_tensor.

plot_cry_multiseebeck(*seebeck)

Deprecated. Use plot_transport_tensor.

plot_cry_sigma_potential(sigma_obj)

Deprecated. Use plot_transport_tensor.

plot_cry_sigma_carrier(sigma_obj)

Deprecated. Use plot_transport_tensor.

plot_cry_multisigma(*sigma)

Deprecated. Use plot_transport_tensor.

plot_cry_powerfactor_potential(seebeck_obj, sigma_obj)

Deprecated. Use plot_transport_tensor.

plot_cry_powerfactor_carrier(seebeck_obj, sigma_obj)

Deprecated. Use plot_transport_tensor.

plot_cry_zt(seebeck_obj, sigma_obj)

Deprecated. Use plot_transport_tensor.