pypsa.plot.add_legend_patches

pypsa.plot.add_legend_patches#

pypsa.plot.add_legend_patches(ax, colors, labels, patch_kw=None, legend_kw=None)#

Add patches for color references.

Parameters:
  • ax (matplotlib ax)

  • colors (list-like, float) – Color of the patch; for example [“r”, “g”, “b”]

  • labels (list-like, str) – Label of the patch; for example [“wind”, “solar”, “gas”]

  • patch_kw (defaults to {}) – Keyword arguments passed to matplotlib.patches.Patch

  • legend_kw (defaults to {}) – Keyword arguments passed to ax.legend