roseau.load_flow.plotting

Plotting functions for roseau.load_flow.

Functions

plot_voltage_phasors(→ matplotlib.axes.Axes)

Plot the voltage phasors of a bus, load, or voltage source.

plot_symmetrical_voltages(→ matplotlib.axes.Axes)

Plot the symmetrical voltages of a bus, load, or voltage source.

plot_interactive_map(→ folium.Map)

Plot an electrical network on an interactive map.

Module Contents

plot_voltage_phasors(element: Bus | AbstractLoad | VoltageSource, *, ax: Axes | None = None) Axes

Plot the voltage phasors of a bus, load, or voltage source.

Parameters:
  • element – The bus, load or source whose voltages to plot.

  • ax – The axes to plot on. If None, the currently active axes object is used.

Returns:

The axes with the plot.

plot_symmetrical_voltages(element: Bus | AbstractLoad | VoltageSource, *, ax: Axes | None = None) Axes

Plot the symmetrical voltages of a bus, load, or voltage source.

Parameters:
  • element – The bus, load or source whose symmetrical voltages to plot. The element must have ‘abc’ or ‘abcn’ phases.

  • ax – The axes to plot on. If None, the current axes object is used.

Returns:

The axes with the plot.

plot_interactive_map(network: ElectricalNetwork, *, style_color: str = '#234e83', highlight_color: str = '#cad40e', style_function: Callable[[FeatureMap], StyleDict | None] | None = None, highlight_function: Callable[[FeatureMap], StyleDict | None] | None = None, map_kws: Mapping[str, Any] | None = None) folium.Map

Plot an electrical network on an interactive map.

This function uses the folium library to create an interactive map of the electrical network.

Make sure you have defined the geometry of the buses and lines in the network before using this function. You can do this by setting the geometry attribute of the buses and lines.

Parameters:
  • network – The electrical network to plot. Only the buses and lines are currently plotted.

  • style_color – The color of the default style of an element. Defaults to ■ #234e83.

  • highlight_color – The color of the default style when an element is highlighted. Defaults to ■ #cad40e.

  • style_function – Function mapping a GeoJson Feature to a style dict. If not provided or when it returns None, the default style is used.

  • highlight_function – Function mapping a GeoJson Feature to a style dict for mouse events. If not provided or when it returns None, the default highlight style is used.

  • map_kws – Additional keyword arguments to pass to the folium.Map constructor. By default, location is set to the centroid of the network geometry and zoom_start is calculated based on its bounding box.

Returns:

The folium.Map object with the network plot.