Plot Helpers#

Functions for adding data layers to a PlotManager.

Adding Parcels#

shift.add_parcels_to_plot(parcels: list[ParcelModel], plot_manager: PlotManager, name: str = 'Polygon Parcels')#

Plots given list of parcels.

Parameters:
  • parcels (list[ParcelModel]) – List of parcels to plot

  • plot_manager (PlotManager) – Plot manager instance

  • name (str) – Name of the plot.

Examples

>>> from shift import PlotManager
>>> plt_instance = PlotManager(GeoLocation(0, 0))
>>> add_parcels_to_plots(
    parcels=[ParcelModel(name="parcel-1", geometry=GeoLocation(0, 0))],
    plot_manager=plt_instance
    )

Adding Networks#

shift.add_xy_network_to_plot(graph: Graph, plot_manager: PlotManager, name: str = 'Graph nodes')#

Function to plot xy network.

Assumes longitude is availabe as x and latitude is available as y.

Parameters:
  • graph (nx.Graph) – Instance of the graph.

  • plot_manager (PlotManager) – PlotManager Instance.

  • name (str) – Name of the plot.

Examples

>>> import networkx as nx
>>> from shift import PlotManager, GeoLocation
>>> graph = nx.Graph()
>>> graph.add_node("node1", x=-97.332, y=43.223)
>>> graph.add_node("node2", x=-97.334, y=43.334)
>>> graph.add_edge("node1", "node2")
>>> plt_instance = PlotManager(GeoLocation(-97.332, 43.223))
>>> add_xy_network_to_plots(graph, plt_instance)
>>> plt_instance.show()

Adding Distribution Graphs#

shift.add_distribution_graph_to_plot(graph: DistributionGraph, plot_manager: PlotManager, name: str = 'Graph nodes')#

Function to plot distribution graph.

Parameters:
  • graph (DistributionGraph) – Instance of the DistributionGraph.

  • plot_manager (PlotManager) – PlotManager Instance.

  • name (str) – Name of the plot.

Adding Phase Mapper Overlays#

shift.add_phase_mapper_to_plot(phase_mapper: BasePhaseMapper, plot_manager: PlotManager)#

Function to add plots for different combinations of phases.

Adding Voltage Mapper Overlays#

shift.add_voltage_mapper_to_plot(voltage_mapper: BaseVoltageMapper, plot_manager: PlotManager)#

Function to add plots for different combinations of phases.