plot_cycle_closure#

cinnabar.plotting.plot_cycle_closure(fe_map: FEMap, filename: str | None, max_cycle_length: int = 5, sources: list[str] | None = None, bin_width: float = 0.5) Figure[source]#

Plot a histogram of cycle closure errors, taking the cc_per_edge (kcal/mol) which is the cycle closure divided by the square root of the cycle length.

Parameters:
  • fe_map (FEMap) – FEMap object containing the calculated edges.

  • filename (str | None, default None) – If provided, the plot will be saved to this filename.

  • max_cycle_length (int, default 5) – Only consider cycles up to this length. Defaults to 5.

  • sources (list[str] | None, default None) – List of sources to plot. If None, all sources are plotted.

  • bin_width (float, default 0.5) – Width of histogram bins in kcal/mol. Default: 0.5

Returns:

The matplotlib Figure object containing the histogram which can be edited further.

Return type:

plt.Figure

Raises:

ValueError – If the FEMap contains no cycles, or if a requested source cannot be found.