atomica.plotting.plot_legend

atomica.plotting.plot_legend(entries, plot_type=None, fig=None, legendsettings=None)[source]

Render a new legend

Parameters:
  • entries (dict) – Dict where key is the label and value is the colour e.g. {‘sus’:’blue’,’vac’:’red’}

  • plot_type – Optionally specify ‘patch’, ‘line’, ‘circle’, or a list the same length as param_entries containing these values

  • fig – Optionally takes in the figure to render the legend in. If not provided, a new figure will be created

  • legendsettings (dict) – settings for the layout of the legend. If not provided will default to appropriate values depending on whether the legend is separate or together with a plot

Returns:

The matplotlib Figure object containing the legend