custom_legend

hhpy.plotting.custom_legend(colors: Union[list, str], labels: Union[list, str], do_show=True) → Optional[list][source]

uses patches to create a custom legend with the specified colors

Parameters:
  • colors – list of matplotlib colors to use for the legend
  • labels – list of labels to use for the legend
  • do_show – whether to show the created legend
Returns:

if do_show: None, else handles