survive.utils.add_legend

survive.utils.add_legend(ax, legend_kwargs=None)[source]

Add a legend to a plot.

Parameters:
ax : matplotlib.axes.Axes

The axes on which to add the legend.

legend_kwargs : dict, optional

Dictionary of keyword parameters to pass to matplotlib.axes.Axes.legend().

Returns:
legend : matplotlib.legend.Legend

The matplotlib.legend.Legend instance added to the plot.