Create Collections

Matplotlib collections can be created from pandapower networks with the following functions:

Bus Collections

pandapower.plotting.create_bus_collection(net, buses=None, size=5, marker='o', patch_type='circle', colors=None, cmap=None, norm=None, infofunc=None, picker=False, **kwargs)

Creates a matplotlib patch collection of pandapower buses.

Input:
net (pandapowerNet) - The pandapower network
OPTIONAL:
buses (list, None) - The buses for which the collections are created.
If None, all buses in the network are considered.

size (int, 5) - patch size

marker (str, “o”) - patch marker

patch_type (str, “circle”) - patch type, can be

  • “circle” for a circle
  • “rect” for a rectangle
  • “poly<n>” for a polygon with n edges

infofunc (function, None) - infofunction for the patch element

colors (list, None) - list of colors for every element

cmap - colormap for the patch colors

picker - picker argument passed to the patch collection

**kwargs - key word arguments are passed to the patch function

Branch Collections

pandapower.plotting.create_line_collection(net, lines=None, use_line_geodata=True, infofunc=None, cmap=None, norm=None, picker=False, z=None, cbar_title='Line Loading [%]', **kwargs)

Creates a matplotlib line collection of pandapower lines.

Input:
net (pandapowerNet) - The pandapower network
OPTIONAL:

lines (list, None) - The lines for which the collections are created. If None, all lines in the network are considered.

use_line_geodata* (bool, True) - defines if lines patches are based on net.line_geodata of the lines (True) or on net.bus_geodata of the connected buses (False)

infofunc (function, None) - infofunction for the patch element

**kwargs - key word arguments are passed to the patch function

pandapower.plotting.create_trafo_collection(net, trafos=None, **kwargs)

Creates a matplotlib line collection of pandapower transformers.

Input:
net (pandapowerNet) - The pandapower network
OPTIONAL:

trafos (list, None) - The transformers for which the collections are created. If None, all transformers in the network are considered.

**kwargs - key word arguments are passed to the patch function