atomica.cascade.plot_cascade

atomica.cascade.plot_cascade(results=None, cascade=None, pops=None, year=None, data=None, show_table=None)[source]

Plot single or multiple cascade plot

plot_single_cascade() generates a plot where multiple results each have their own figure. A common requirement (used on the FE) is to decide between calling plot_single_cascade() or calling plot_multi_cascade() based on whether there are multiple Result instances or not.

A multi-cascade plot will be displayed if there are multiple years or if there are multiple results. Thus this function is always guaranteed to return a single figure.

Parameters:
  • results – A single Result instance, or list of instances

  • cascade – A cascade specification supported by sanitize_cascade()

  • pops – A population specification supported by sanitize_pops() - must correspond to a single aggregation

  • year – A single year, or multiple years (can be a scalar, list, or array)

  • data – A ProjectData instance

  • show_table (bool) – If True and a multi-cascade plot is generated, then the loss table will also be shown

Returns:

Figure object containing the plot that was produced