wntr.graphics.layer module

The wntr.graphics.layer module includes methods plot water network data layers.

wntr.graphics.layer.plot_valve_layer(wn, valve_layer, valve_attribute=None, title=None, valve_size=15, valve_range=[None, None], valve_cmap=None, add_colorbar=True, colorbar_label=None, include_network=True, ax=None, filename=None)[source]

Plot valve layer

Parameters
  • wn (wntr WaterNetworkModel) – A WaterNetworkModel object

  • valve_layer (pd.Dataframe, optional) – Valve layer, defined by node and link pairs (for example, valve 0 is on link A and protects node B). The valve_layer DataFrame is indexed by valve number, with columns named ‘node’ and ‘link’.

  • valve_attribute (pd.Series, optional) – Attribute for each valve

  • title (str, optional) – Plot title

  • valve_size (int, optional) – Node size

  • valve_range (list, optional) – Value range used to scale colormap ([None,None] indicates autoscale)

  • valve_cmap (matplotlib.pyplot.cm colormap or named color, optional) – Valve colormap

  • add_colorbar (bool, optional) – Add colorbar

  • colorbar_label (str, optional) – Node colorbar label

  • include_network (bool, options) – Include a plot of the water network

  • ax (matplotlib axes object, optional) – Axes for plotting (None indicates that a new figure with a single axes will be used)

  • filename (str, optional) – Filename used to save the figure

Returns

ax (matplotlib axes object)