InteractiveCohpPlotter#

class lobsterpy.plotting.InteractiveCohpPlotter(zero_at_efermi=True, are_coops=False, are_cobis=False)[source]#

Bases: CohpPlotter

Interactive COHP, COBI or COOP plotter to view all relevant bonds in one figure.

Parameters:
  • zero_at_efermi – Shift all populations to have zero energy at the Fermi level. Defaults to True.

  • are_coops – Bool indicating that populations are COOPs, not COHPs. Defaults to False for COHPs.

  • are_cobis – Bool indicating that populations are COBIs, not COHPs. Defaults to False for COHPs.

add_cohp(label, cohp)[source]#

Add COHP object to the plotter.

Parameters:
  • label (str) – Label for the COHP. Must be unique.

  • cohp (Cohp) – COHP object.

add_all_relevant_cohps(analyse, suffix='', label_resolved=True, orbital_resolved=False)[source]#

Add all relevant COHPs from lobsterpy analyse object.

Parameters:
  • analyse (Analysis) – Analyse object from lobsterpy.

  • suffix (str) – Optional addition to LOBSTER label to avoid key conflicts when plotting multiple calcs or just for additional legend information.

  • label_resolved (bool) – bool indicating to obtain label resolved interactive plots for relevant bonds. If false, will return summed cohp curves of unique relevant bonds.

  • orbital_resolved (bool) – bool indicating to include orbital resolved interactive cohps for relevant bonds.

Return type:

None

add_cohps_by_lobster_label(analyse, label_list, suffix='')[source]#

Add COHPs explicitly specified in label list.

Parameters:
  • analyse (Analysis) – Analyse object from lobsterpy.

  • label_list (list[str]) – List of COHP labels as from LOBSTER.

  • suffix (str) – Optional addition to LOBSTER label to avoid key conflicts when plotting multiple calcs or just for additional legend information.

add_cohps_from_plot_data(plot_data_dict, suffix='')[source]#

Add all relevant COHPs for specified bond type from lobster lightweight json.gz file.

Parameters:
  • plot_data_dict (dict[str, Cohp]) – Lobsterpy plot data dict

  • suffix (str) – Optional addition to LOBSTER label to avoid key conflicts when plotting multiple calcs or just for additional legend information.

get_plot(xlim=None, rangeslider=False, ylim=None, plot_negative=None, integrated=False, invert_axes=True, sigma=None, colors=None)[source]#

Get an interactive plotly figure showing the COHPs.

Parameters:
  • xlim (list[float] | None) – Specifies the x-axis limits. Defaults to None for automatic determination.

  • rangeslider (bool) – Adds a plotly.graph_objs.layout.xaxis.Rangeslider object to figure to allow easy manipulation of x-axis..

  • ylim (list[float] | None) – Specifies the y-axis limits. Defaults to None for automatic determination.

  • plot_negative (bool | None) – It is common to plot -COHP(E) so that the sign means the same for COOPs and COHPs. Defaults to None for automatic determination - If are_coops is True, this will be set to False, else it will be set to True.

  • integrated (bool) – Switch to plot ICOHPs. Defaults to False.

  • invert_axes (bool) – Put the energies onto the y-axis, which is common in chemistry.

  • sigma (float | None) – Standard deviation of Gaussian broadening applied to population data. If this is unset (None) no broadening will be added.

  • colors (list[str] | None) – list of hex color codes to be used in plot

Returns:

A plotly.graph_objects.Figure object.