topotherm.plotting

Sone standard plotting functions for the district heating network.

Functions

district(matrices[, diameter, isnot_init])

Plot the district heating network with the given matrices.

plot_networkx(n)

Plot a NetworkX graph.

Module Contents

topotherm.plotting.district(matrices, diameter=[0], isnot_init=False)[source]

Plot the district heating network with the given matrices.

Parameters:
  • matrices (dict) –

    Matrices of the district heating network with keys:

    • a_i : Incidence matrix (rows: nodes, columns: edges).

    • a_p : Adjacency matrix for the producers (rows: nodes, columns: supply IDs).

    • a_c : Adjacency matrix for the consumers (rows: nodes, columns: consumer IDs).

    • l_i : Length of edges.

    • position : (x, y) coordinates of the nodes in the network.

  • diameter (list of float, optional) – Inner diameter of the pipes. Default is [0].

  • isnot_init (bool, optional) – Whether to plot after optimization (True) or before (False). Default is False.

Returns:

Figure of the district heating network.

Return type:

plt.Figure

topotherm.plotting.plot_networkx(n)[source]

Plot a NetworkX graph.

Parameters:

n (networkx.Graph) – Input NetworkX graph.

Returns:

Figure of the NetworkX graph.

Return type:

matplotlib.figure.Figure