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., patch_type='circle', color=None, z=None, cmap=None, norm=None, infofunc=None, picker=False, bus_geodata=None, bus_table='bus', cbar_title='Bus Voltage [pu]', clim=None, plot_colormap=True, **kwargs)
Creates a matplotlib patch collection of pandapower buses.
- Parameters:
**net** (pandapowerNet)
**buses** (list, None)
None (If)
considered. (all buses in the network are)
**size** (float, 5)
**patch_type** (str, "circle") –
“circle” for a circle
”rect” for a rectangle
”poly<n>” for a polygon with n edges
**infofunc** (function, None)
**color** (list or color, None)
**z** (array, None)
used. (cmap. If None net.res_bus.vm_pu is)
**cmap** (Colormap, None)
**norm** (matplotlib norm object, None)
**picker** (bool, False)
**bus_geodata** (DataFrame, None)
None
used (net["bus_geodata"] is)
**cbar_title** (str, "Bus Voltage [pu]")
**clim** (tuple of floats, None)
**bus_table** (str, "bus") - element table to use for the buses ("bus", "bus_dc")
**plot_colormap** (bool, True)
function (**kwargs** - key word arguments are passed to the patch)
net (pandapowerNet)
buses (list | None)
size (float)
patch_type (str)
infofunc (Callable | None)
picker (bool)
bus_geodata (DataFrame | None)
bus_table (str)
cbar_title (str)
clim (Tuple[float] | None)
plot_colormap (bool)
- Returns:
pc - patch collection
Branch Collections
- pandapower.plotting.create_line_collection(net, lines=None, line_geodata=None, bus_geodata=None, use_bus_geodata=False, infofunc=None, cmap=None, norm=None, picker=False, z=None, cbar_title='Line Loading [%]', clim=None, plot_colormap=True, line_table='line', **kwargs)
Creates a matplotlib line collection of pandapower lines.
- Parameters:
**net** (pandapowerNet)
**lines** (list, None)
considered. (in the network are)
**line_geodata** (DataFrame, None)
used (If False line_geodata is)
**bus_geodata** (DataFrame, None)
None (If)
used
**use_bus_geodata** (bool, False)
used
aswell (if not all lines have line geodata bus geodata is used)
**infofunc** (function, None)
colors (**cmap** - colormap for the patch)
**norm** (matplotlib norm object, None)
**picker** (bool, False)
**z** (array, None)
used. (cmap. If None net.res_line.loading_percent is)
**cbar_title** (str, "Line Loading [%]")
**clim** (tuple of floats, None)
**line_table** (str, "line") - which element table to use ("line", "line_dc")
**plot_colormap** (bool, True)
function (**kwargs** - key word arguments are passed to the patch)
net (pandapowerNet)
line_geodata (DataFrame)
bus_geodata (DataFrame)
use_bus_geodata (bool)
infofunc (Callable)
cmap (Colormap)
norm (Normalize)
picker (bool)
cbar_title (str)
plot_colormap (bool)
- Returns:
lc - line collection
- pandapower.plotting.create_trafo_collection(net, trafos=None, picker=False, size=None, infofunc=None, cmap=None, norm=None, z=None, clim=None, cbar_title='Transformer Loading', plot_colormap=True, bus_geodata=None, **kwargs)
Creates a matplotlib line collection of pandapower transformers.
- Parameters:
**net** (pandapowerNet)
**trafos** (list, None)
None (If)
considered. (all transformers in the network are)
**picker** (bool, False)
**size** (int, None)
0.35*bus_distance (<) – infofunc (function, None) - infofunction for the patch element
function (**kwargs** - key word arguments are passed to the patch)
- Returns:
lc - line collection
pc - patch collection