pyorps.utils.plotting

PYORPS: An Open-Source Tool for Automated Power Line Routing

Reference: [1] Hofmann, M., Stetz, T., Kammer, F., Repo, S.: ‘PYORPS: An Open-Source Tool for

Automated Power Line Routing’, CIRED 2025 - 28th Conference and Exhibition on Electricity Distribution, 16 - 19 June 2025, Geneva, Switzerland

Classes

PathPlotter(paths, raster_handler)

A class for visualizing paths from a PathCollection.

RasterVizData()

Container for raster visualization data used for plotting.

class pyorps.utils.plotting.RasterVizData[source]

Bases: object

Container for raster visualization data used for plotting.

Initialize empty visualization data containers.

__init__()[source]

Initialize empty visualization data containers.

Return type:

None

class pyorps.utils.plotting.PathPlotter(paths, raster_handler)[source]

Bases: object

A class for visualizing paths from a PathCollection.

This class provides functionality to plot paths with options to: - Display all paths or individual paths - Show or hide the raster data as background - Customize markers, colors, and other visual elements - Create individual subplots for each path or combine them

Initialize the PathPlotter with a path collection and raster handler.

Parameters:
  • paths (PathCollection) – Collection of Path objects to plot

  • raster_handler (RasterHandler) – RasterHandler object containing the raster data

__init__(paths, raster_handler)[source]

Initialize the PathPlotter with a path collection and raster handler.

Parameters:
  • paths (PathCollection) – Collection of Path objects to plot

  • raster_handler (RasterHandler) – RasterHandler object containing the raster data

Return type:

None

plot_paths(plot_all=True, subplots=True, subplotsize=(10, 8), source_color='green', target_color='red', path_colors=None, source_marker='o', target_marker='x', path_linewidth=2, show_raster=True, title=None, suptitle=None, path_id=None, reverse_colors=False)[source]

Plot paths with options to display all paths or individual paths.

Parameters:
  • plot_all (bool) – If True, plot all paths. If False, plot only the path with path_id.

  • subplots (bool) – If True and plot_all is True, create subplots for each path.

  • subplotsize (Tuple[int, int]) – Size of each individual subplot in inches. Defaults to (10, 8).

  • source_color (str) – Color for source marker. Defaults to ‘green’.

  • target_color (str) – Color for target marker. Defaults to ‘red’.

  • path_colors (str | List[str] | None) – Colors for paths. If None, uses default colors.

  • source_marker (str) – Marker style for source. Defaults to ‘o’.

  • target_marker (str) – Marker style for target. Defaults to ‘x’.

  • path_linewidth (int) – Line width for paths. Defaults to 2.

  • show_raster (bool) – Whether to show raster data as background. Defaults to True.

  • title (str | List[str] | None) – Subplot title(s). If None, default titles are created.

  • suptitle (str | None) – The subtitle of the entire figure. Defaults to None.

  • path_id (list[int] | int | None) – ID of specific path to plot when plot_all is False.

  • reverse_colors (bool) – Whether to reverse the color scheme (low=dark, high=bright)

Returns:

The axes object(s) with the plot. If multiple subplots are created, returns a list.

Return type:

matplotlib.axes.Axes | List[matplotlib.axes.Axes]