network_animation#
module wntr.graphics.network
- network_animation(wn, node_attribute=None, link_attribute=None, title=None, node_size=20, node_range=[None, None], node_alpha=1, node_cmap=None, node_labels=False, link_width=1, link_range=[None, None], link_alpha=1, link_cmap=None, link_labels=False, add_colorbar=True, directed=False, ax=None, repeat=True)[source]#
Create a network animation
- Parameters:
wn (wntr WaterNetworkModel) – A WaterNetworkModel object
node_attribute (pd.DataFrame, optional) – Node attributes stored in a pandas DataFrames, where the index is time and columns are the node name
link_attribute (pd.DataFrame, optional) – Link attributes stored in a pandas DataFrames, where the index is time and columns are the link name
title (str, optional) – Plot title
node_size (int, optional) – Node size
node_range (list, optional) – Node range ([None,None] indicates autoscale)
node_alpha (int, optional) – Node transparency
node_cmap (matplotlib.pyplot.cm colormap or list of named colors, optional) – Node colormap
node_labels (bool, optional) – If True, the graph will include each node labelled with its name.
link_width (int, optional) – Link width
link_range (list, optional) – Link range ([None,None] indicates autoscale)
link_alpha (int, optional) – Link transparency
link_cmap (matplotlib.pyplot.cm colormap or list of named colors, optional) – Link colormap
link_labels (bool, optional) – If True, the graph will include each link labelled with its name.
add_colorbar (bool, optional) – Add colorbar
directed (bool, optional) – If True, plot the directed graph
repeat (bool, optional) – If True, the animation will repeat
- Return type:
matplotlib animation