viswaternet.drawing package
Submodules
viswaternet.drawing.animate module
The viswaternet.drawing.animate module contains the code that handles creation of animations. One can create animations from simulation data, or pass in outside data to be animated on the network.
- viswaternet.drawing.animate.animate_plot(self, function, ax=None, fps=3, first_timestep=0, last_timestep=None, save_name='animation', save_format='mp4', time_unit='s', **kwargs)[source]
Builds .gif file animating network data across timesteps.
- Parameters:
ax (axes._subplots.AxesSubplot) – Matplotlib axes object.
function (viswaternet) –
One of the general viswaternet drawing functions.
Usable Functions
plot_basic_elements
plot_discrete_nodes
plot_discrete_links
plot_continuous_nodes
plot_continuous_links
plot_unique_data
fps (integer) – Framerate that the .gif file will be generated with.
first_timestep (integer) – The starting timestep of the .gif file.
last_timestep (integer) – The last timestep of the .gif file.
save_name (string) – The file name that will be used when saving the animation.
save_format (string) –
The file format that the animation will be saved to. A comprehensive list of formats can be found on the imageio docs page:
time_unit (string) –
The time unit that will be reported for each frame of the .gif file.
Time Units
Default
\(s\)
min
\(min\)
hr
\(hr\)
day
\(day\)
kwargs (Any) – Any arguments for the plotting function passed into the function argument can be passed into animate_plot.
viswaternet.drawing.base module
The viswaternet.utils.base module contains plotting functions that are frequently utilized by other plotting functions. This includes base element drawing, legend drawing, color map, and label drawing functions.
- viswaternet.drawing.base.draw_base_elements(self, ax, draw_nodes=True, element_list=None, draw_originator=None, style=None)[source]
Draws base elements (draw_nodes, draw_links, draw_reservoirs, draw_tanks, draw_pumps, and draw_valves) without any data associated with the elements.
- Parameters:
ax (axes._subplots.AxesSubplot) – Matplotlib axes object.
draw_nodes (boolean) – Determines if base draw_nodes with no data associated with them are drawn. Set to False for all functions excep plot_basic_elements by default.
element_list (array-like) – The list of elements being drawn. Can either be links or nodes, but not a combination. When this is None, all links/nodes are drawn, but if not None only the ones listed are drawn.
draw_originator (string) – Used with element_list and stores whether the elements being drawn are nodes or links.
style (VisWaterNet Style Object) – The style object to be used.
- viswaternet.drawing.base.draw_color_bar(self, ax, g, color_bar_title=None, style=None)[source]
Draws the color bar for all continuous plotting functions. Like draw_legends, under normal use, draw_color_bar is not normally called by the user directly, even with more advanced applications. However, some specialized plots may require draw_color_bar to be called directly.
- Parameters:
ax (axes._subplots.AxesSubplot) – Matplotlib axes object.
g (NetworkX path collection) – The list of elements drawn by NetworkX function.
color_bar_title (string) – The title of the color bar.
style (VisWaterNet Style Object) – The style object to be used.
- viswaternet.drawing.base.draw_label(self, labels, x_coords, y_coords, ax=None, draw_nodes=None, draw_arrow=True, label_font_size=11, label_text_color='k', label_face_color='white', label_edge_color='k', label_alpha=0.9, label_font_style=None, label_edge_width=None)[source]
Draws customizable labels on the figure. There are two modes of coordinate input: If the ‘draw_nodes’ argument is not specified, then the label coordinates are processed as absolute coordinates with possible values from 0 to 1. For instance, (0,0) would place the label in the bottom left of the figure, while (1,1) would place the label in the top right of the figure. If the ‘draw_nodes’ argument is specified, then the coordinates are processed as coordinates relative to it’s associated node. The scale of the coordinates scaling differs between networks. For instance, (50,100) would place the label 50 units to the right, and 100 units above the associated node.
- Parameters:
ax (axes._subplots.AxesSubplot) – Matplotlib axes object.
labels (string, array-like) – The label(s) textual content.
x_coords (integer, array-like) – The x coordinate(s) of the labels.
y_coords (integer, array-like) – The y coordinate(s) of the labels.
draw_nodes (string, array-like) – A list of the draw_nodes the labels are to be associated with.
draw_arrow (boolean) – Determine if an arrow is drawn from the associated draw_nodes to labels.
label_font_size (integer) – The font size of the labels.
label_text_color (string) – The color of the text of the labels.
label_face_color (string) – The face color of the label.
label_edge_color (string) – The edge color of the label
label_alpha (integer) – The transparency of the label. Takes a value between 0.0 and 1.0.
label_font_style (string) – The font style of the label. Takes ‘normal’, ‘italic’, or ‘oblique’.
label_edge_width (integer) – The width of the label edge.
- viswaternet.drawing.base.draw_legend(self, ax, intervals=None, title=None, element_size_intervals=None, element_size_legend_title=None, element_size_legend_loc=None, element_size_legend_labels=None, style=None)[source]
Draws the legends for all other plotting functions. There are two legends that might be drawn. One is the base elements legend with displays what markers are associated with each element type (draw_nodes, draw_links, etc.) The other legend is the intervals legend which is the legend for discrete drawing. Under normal use, draw_legends is not normally called by the user directly, even with more advanced applications. However, some specialized plots may require draw_legend to be called directly.
- Parameters:
ax (axes._subplots.AxesSubplot) – Matplotlib axes object.
intervals (array-like, string) – If set to ‘automatic’ then intervals are created automatically on an equal interval basis. Otherwise, it is the edges of the intervals to be created. intervals array length should be num_intervals + 1.
color_list (string, array-like) – The list of node colors for each interval. Both cmap and color_list can not be used at the same time to color draw_nodes. If both are, then color_list takes priority.
cmap (string) –
The matplotlib color map to be used for plotting. Refer to matplotlib documentation for possible inputs.
title (string) – The title text of the legend.
element_size_intervals (integer) – The number of intervals to be used if an element size legend is used.
element_size_legend_title (string) – The title of the element size legend.
element_size_legend_loc (string) – The location of the element size legend on the figure.
element_size_legend_labels (array-like) – The labels of each interval of the element size legend.
style (VisWaterNet Style Object) – The style object to be used.
- viswaternet.drawing.base.draw_links(self, ax, link_list, parameter_results=None, link_width=None, link_style=None, link_arrows=None, link_color=None, vmin=None, vmax=None, label=None, style=None)[source]
Draws continuous link data onto the figure.
- Parameters:
ax (axes._subplots.AxesSubplot) – Matplotlib axes object.
link_list (string, array-like) – List of draw_links to be drawn.
parameter_results (array-like) – The data associated with each node.
link_width (string, array-like) –
The width of the link being drawn. Can either be a single string value or an array of values for each link being drawn.
Should only be used if calling draw_links() manually.
link_style (string, array-like) –
The style of the link being drawn. Can either be a single string value or an array of values for each link being drawn.
Should only be used if calling draw_links() manually.
- Refer to the matplotlib documentation for available link styles.
https://matplotlib.org/stable/gallery/lines_bars_and_markers/linestyles.html
link_arrows (string, array-like) –
Whether arrows should be drawn for each link. Can either be a single string value or an array of values for each link being drawn.
Should only be used if calling draw_links() manually.
link_color (string, array-like) –
The color the link being drawn. Can either be a single string value or an array of values for each link being drawn.
Should only be used if calling draw_links() manually.
vmin (integer) – The minimum value of the color bar.
vmax (integer) – The maximum value of the color bar.
label (string, array-like) –
Labels to be assigned to each of the nodes drawn. Can either be a single string value or an array of values for each node being drawn.
(Not Implemented Yet)
Should only be used if calling draw_links() manually.
style (VisWaterNet Style Object) – The style object to be used.
- viswaternet.drawing.base.draw_nodes(self, ax, node_list, parameter_results=None, node_size=None, node_shape=None, node_border_width=None, node_border_color=None, node_color=None, vmin=None, vmax=None, label=None, style=None)[source]
Draws continuous nodal data onto the figure.
- Parameters:
ax (axes._subplots.AxesSubplot) – Matplotlib axes object.
node_list (string, array-like) – List of draw_nodes to be drawn.
parameter_results (array-like) – The data associated with each node.
node_size (integer, array-like) –
The size of the nodes being drawn. Can either be a single string value or an array of values for each node being drawn.
Should only be used if calling draw_nodes() manually.
node_shape (string, array-like) –
The shape of the nodes being drawn. Can either be a single string value or an array of values for each node being drawn.
Should only be used if calling draw_nodes() manually.
- Refer to the matplotlib documentation for available marker types.
node_border_color (string, array-like) –
The color of the node borders for the nodes being drawn. Can either be a single string value or an array of values for each node being drawn.
Should only be used if calling draw_nodes() manually.
node_border_width (integer, array-like) –
The width of the node borders. Can either be a single string value or an array of values for each node being drawn.
Should only be used if calling draw_nodes() manually.
vmin (integer) – The minimum value of the color bar.
vmax (integer) – The maximum value of the color bar.
label (string, array-like) –
Labels to be assigned to each of the nodes drawn. Can either be a single string value or an array of values for each node being drawn.
(Not Implemented Yet)
Should only be used if calling draw_nodes() manually.
style (VisWaterNet Style Object) – The style object to be used.
- viswaternet.drawing.base.plot_basic_elements(self, ax=None, draw_nodes=True, savefig=False, save_name=None, style=None)[source]
User-level function that draws base elements with no data assocaited with them, draws a legend, and saves the figure.
- Parameters:
ax (axes._subplots.AxesSubplot) – Matplotlib axes object.
draw_nodes (boolean) – Determines if base draw_nodes with no data associated with them are drawn. Set to False for all functions excep plot_basic_elements by default.
savefig (boolean) – Determines if the figure is saved.
save_name (string) –
The inputted string will be appended to the name of the network.
Example
>>>import viswaternet as vis >>>model = vis.VisWNModel(r’Networks/Net3.inp’) … >>>model.save_fig(save_name=’_example’) <Net3_example.png>
style (VisWaterNet Style Object) – The style object to be used.
viswaternet.drawing.continuous module
The viswaternet.drawing.continuous module handles everything related to continuous data drawing.
- viswaternet.drawing.continuous.plot_continuous_links(self, ax=None, parameter=None, element_list=None, include_pumps=True, include_valves=True, value=None, unit=None, vmin=None, vmax=None, draw_nodes=False, savefig=False, save_name=None, element_size_intervals=None, element_size_legend_title=None, element_size_legend_loc=None, element_size_legend_labels=None, color_bar_title=None, style=None)[source]
User-level function that draws continuous link data, base elements, legends, and saves the figure.
- Parameters:
ax (axes._subplots.AxesSubplot) – Matplotlib axes object.
parameter (string) –
The parameter to be plotted. The following is a list of parameters available to use: Static Parameters - length - minor_loss - bulk_coeff - wall_coeff
Time-Dependent Parameters - flowrate - velocity - headloss - friction_factor - reaction_rate - quality
element_list (list) – A list of links for which the parameter will be plotted. By default, this is the list of all link names.
include_pumps (boolean) – Determines if data for draw_pumps are retreived.
include_valves (boolean) – Determines if data for draw_valves are retrieved
value (integer, string) –
For time-varying parameters only. Specifies which timestep or data summary will be plotted.
Possible Inputs
int
Plots element data for specified timestep
’min’
Plots minimum data point for each element
’max’
Plots maximum data point for each element
’mean’
Plots mean for each element
’stddev’
Plots standard deviation for each element
’range’
Plots range for each element
unit (string) – The unit that the network data is to be converted to.
vmin (integer) – The minimum value of the color bar.
vmax (integer) – The maximum value of the color bar.
element_size_intervals (integer) – The number of intervals to be used if an element size legend is used.
element_size_legend_title (string) – The title of the element size legend.
element_size_legend_loc (string) – The location of the element size legend on the figure.
element_size_legend_labels (array-like) – The labels of each interval of the element size legend.
color_bar_title (string) – The title of the color bar.
savefig (boolean) – Determines if the figure is saved.
save_name (string) –
The inputted string will be appended to the name of the network.
Example
>>>import viswaternet as vis >>>model = vis.VisWNModel(r’Networks/Net3.inp’) … >>>model.save_fig(save_name=’_example’) <Net3_example.png>
style (VisWaterNet Style Object) – The style object to be used.
- viswaternet.drawing.continuous.plot_continuous_nodes(self, ax=None, parameter=None, element_list=None, include_tanks=False, include_reservoirs=False, value=None, unit=None, vmin=None, vmax=None, draw_nodes=False, element_size_intervals=None, element_size_legend_title=None, element_size_legend_loc=None, element_size_legend_labels=None, color_bar_title=None, savefig=False, save_name=None, style=None)[source]
User-level function that draws continuous nodal data, base elements, legends, and saves the figure.
- Parameters:
ax (axes._subplots.AxesSubplot) – Matplotlib axes object.
parameter (string) –
The parameter to be plotted. The following is a list of parameters available to use:
Static Parameters - base_demand - elevation - emitter_coefficient - initial_quality
Time-Dependent Parameters - head - demand - pressure - quality - leak_demand - leak_area - leak_discharg_coeff
element_list (list) – A list of junctions for which the parameter will be plotted. By default, this is the list of all junction names.
include_tanks (boolean) – Determines if data for draw_tanks are retrieved.
include_reservoirs (boolean) – Determines if data for draw_reservoirs are retrieved.
value (integer, string) –
For time-varying parameters only. Specifies which timestep or data summary will be plotted.
Possible Inputs
int
Plots element data for specified timestep
’min’
Plots minimum data point for each element
’max’
Plots maximum data point for each element
’mean’
Plots mean for each element
’stddev’
Plots standard deviation for each element
’range’
Plots range for each element
unit (string) – The unit that the network data is to be converted to.
vmin (integer) – The minimum value of the color bar.
vmax (integer) – The maximum value of the color bar.
element_size_intervals (integer) – The number of intervals to be used if an element size legend is used.
element_size_legend_title (string) – The title of the element size legend.
element_size_legend_loc (string) – The location of the element size legend on the figure.
element_size_legend_labels (array-like) – The labels of each interval of the element size legend.
color_bar_title (string) – The title of the color bar.
savefig (boolean) – Determines if the figure is saved.
save_name (string) –
The inputted string will be appended to the name of the network.
Example
>>>import viswaternet as vis >>>model = vis.VisWNModel(r’Networks/Net3.inp’) … >>>model.save_fig(save_name=’_example’) <Net3_example.png>
style (VisWaterNet Style Object) – The style object to be used.
viswaternet.drawing.discrete module
The viswaternet.drawing.discrete module handles everything related to discrete data drawing.
- viswaternet.drawing.discrete.draw_discrete_links(self, ax, element_list, intervals, label_list=None, style=None)[source]
Draws discretized link data onto the figure.
- Parameters:
ax (axes._subplots.AxesSubplot) – Matplotlib axes object.
element_list (array-like) – List of network elements that data will be retrieved for.
intervals (dict) – The dictionary containting the intervals and the draw_links associated with each interval.
label_list (string, array-like) – List of labels for each interval.
- viswaternet.drawing.discrete.draw_discrete_nodes(self, ax, element_list, intervals, label_list=None, style=None)[source]
Draws discretized nodal data onto the figure.
- Parameters:
ax (axes._subplots.AxesSubplot) – Matplotlib axes object.
element_list (array-like) – List of network elements that data will be retrieved for.
intervals (dict) – The dictionary containting the intervals and the draw_nodes assocaited with each interval.
label_list (string, array-like) – List of labels for each interval.
style (VisWaterNet Style Object) – The style object to be used.
- viswaternet.drawing.discrete.plot_discrete_links(self, ax=None, num_intervals=5, parameter=None, element_list=None, include_pumps=True, include_valves=True, value=None, unit=None, intervals='automatic', label_list=None, draw_nodes=False, discrete_legend_title=None, savefig=False, save_name=None, disable_interval_deleting=True, style=None)[source]
User-level function that draws discretized link data, base elements, legends, and saves the figure.
- Parameters:
ax (axes._subplots.AxesSubplot) – Matplotlib axes object.
num_intervals (integer) – The number of intervals.
parameter (string) –
The parameter to be plotted. The following is a list of parameters available to use:
Static Parameters - length - minor_loss - bulk_coeff - wall_coeff
Time-Dependent Parameters - flowrate - velocity - headloss - friction_factor - reaction_rate - quality
value (integer, string) –
For time-varying parameters only. Specifies which timestep or data summary will be plotted.
Possible Inputs
int
Plots element data for specified timestep
’min’
Plots minimum data point for each element
’max’
Plots maximum data point for each element
’mean’
Plots mean for each element
’stddev’
Plots standard deviation for each element
’range’
Plots range for each element
unit (string) – The unit that the network data is to be converted to.
element_list (array-like) – List of network elements that data will be retrieved for.
include_pumps (boolean) – Determines if data for draw_pumps are retrieved.
include_valves (boolean) – Determines if data for draw_valves are retrieved.
intervals (integer, string) – If set to ‘automatic’ then intervals are created automatically on an equal interval basis. Otherwise, it is the edges of the intervals to be created. intervals array length should be num_intervals + 1.
disable_interval_deleting (boolean) – If True, empty intervals will be automatically deleted.
label_list (string, array-like) – List of labels for each interval.
draw_nodes (boolean) – Determines if draw_nodes with no data associated with them are drawn.
discrete_legend_title (string) – Title of the intervals legend.
savefig (boolean) – Determines if the figure is saved.
save_name (string) –
The inputted string will be appended to the name of the network.
Example
>>>import viswaternet as vis >>>model = vis.VisWNModel(r’Networks/Net3.inp’) … >>>model.save_fig(save_name=’_example’) <Net3_example.png>
style (VisWaterNet Style Object) – The style object to be used.
- viswaternet.drawing.discrete.plot_discrete_nodes(self, ax=None, num_intervals=5, parameter=None, value=None, unit=None, element_list=None, include_tanks=False, include_reservoirs=False, intervals='automatic', label_list=None, savefig=False, save_name=None, draw_nodes=True, discrete_legend_title=None, disable_interval_deleting=True, style=None)[source]
User-level function that draws discretized nodal data, base elements, legends, and saves the figure.
- Parameters:
ax (axes._subplots.AxesSubplot) – Matplotlib axes object.
num_intervals (integer) – The number of intervals. Results in intervals+1 bins.
parameter (string) –
The parameter to be plotted. The following is a list of parameters available to use:
Static Parameters - base_demand - elevation - emitter_coefficient - initial_quality
Time-Dependent Parameters - head - demand - leak_demand - leak_area - leak_discharg_coeff - quality
value (integer, string) –
For time-varying parameters only. Specifies which timestep or data summary will be plotted.
Possible Inputs
int
Plots element data for specified timestep
’min’
Plots minimum data point for each element
’max’
Plots maximum data point for each element
’mean’
Plots mean for each element
’stddev’
Plots standard deviation for each element
’range’
Plots range for each element
unit (string) – The unit that the network data is to be converted to.
element_list (array-like) – List of network elements that data will be retrieved for.
include_tanks (boolean) – Determines if data for draw_tanks are retrieved.
include_reservoirs (boolean) – Determines if data for draw_reservoirs are retrieved.
intervals (integer, string) – If set to ‘automatic’ then intervals are created automatically on a equal interval basis. Otherwise, it is the edges of the intervals to be created. Intervals array length should be num_intervals + 1.
label_list (string, array-like) – List of labels for each interval.
draw_nodes (boolean) – Determines if draw_nodes with no data associated with them are drawn.
disable_interval_deleting (boolean) – If True, empty intervals will be automatically deleted.
discrete_legend_title (string) – Title of the intervals legend.
savefig (boolean) – Determines if the figure is saved.
save_name (string) –
The inputted string will be appended to the name of the network.
Example
>>>import viswaternet as vis >>>model = vis.VisWNModel(r’Networks/Net3.inp’) … >>>model.save_fig(save_name=’_example’) <Net3_example.png>
style (VisWaterNet Style Object) – The style object to be used.
viswaternet.drawing.unique module
The viswaternet.drawing.unique module handles custom data, excel data, and unique data drawing.
- viswaternet.drawing.unique.plot_unique_data(self, ax=None, parameter=None, parameter_type=None, data_type=None, data_file=None, excel_columns=None, custom_data_values=None, unit=None, intervals='automatic', num_intervals=5, label_list=None, vmin=None, vmax=None, draw_nodes=False, discrete_legend_title=None, savefig=False, save_name=None, color_bar_title=None, element_size_intervals=None, element_size_legend_title=None, element_size_legend_loc=None, element_size_legend_labels=None, disable_interval_deleting=True, style=None)[source]
A complex function that accomplishes tasks relating to categorical data, or ‘unique’ as used in viswaternet, as well as data not retrieved from WNTR.
There are three distinct modes of operation, and which one is used is controlled by the ‘parameter’ argument, which differs from previous use of the argument.
Setting the parameter argument to ‘demand_patterns’, ‘diameter’, or ‘roughness’ simply plots that parameter. These parameters are treated differently from others because in usually they are categorical. For instance, pipe diameters are not randomly chosen, and instead are chosen from a list of standard pipe sizes.
When the parameter argument is set to ‘excel_data’, the function deals with excel data, or data imported from an .xlsx file. Two excel columns with elements and data pairs are provided by the user, which are then converted into a format usable by viswaternet for plotting.
When the parameter argument is set to ‘custom_data’, the function deals with data directly inside of python. The user should expect to format the data themselves, although this shouldn’t be difficult. An example of ‘custom_data’ being used can be seen in example 10 located in the github repository.
- Parameters:
ax (axes._subplots.AxesSubplot) – Matplotlib axes object.
parameter (string) – Should be set to ‘demand_patterns’, ‘diameter’, ‘roughness’, ‘custom_data’ or ‘excel_data’.
parameter_type (string) – Type of parameter (nodal, link)
data_type (string) – The type of data that the excel data is (Unique, continuous, or discrete.)
data_file (string) –
excel_columns (array-like) –
Two values should be provided:
The first should be the excel column that contains element names. Column A in excel is considered the 0th column for use with viswaternet.
The second should be the excel column that contains element data. Column A in excel is considered the 0th column for use with viswaternet.
If intending to animate data using this method, all columns except the first column are treated as data columns and will be animated in order.
custom_data_values (array-like) –
Similar to ‘excel_columns’ two values should be provided. The first value should be an array with element names, and the second should be one with the element data.
If intending to animate data using this method, all values except the first value are treated as data values and will be animated in order. This means that, for example, when animating 10 timesteps using this method you should have 11 arrays inside this array.
unit (string) – The unit that the network data is to be converted to.
intervals (integer, string) – If set to ‘automatic’ then intervals are created automatically on a equal interval basis. Otherwise, it is the edges of the intervals to be created. intervals array length should be num_intervals + 1.
num_intervals (integer) – The number of intervals.
disable_interval_deleting (boolean) – If True, empty intervals will be automatically deleted.
vmin (integer) – The minimum value of the color bar.
vmax (integer) – The maximum value of the color bar.
label_list (string, array-like) – List of labels for each interval.
draw_nodes (boolean) – Determines if draw_nodes with no data associated with them are drawn.
discrete_legend_title (string) – Title of the intervals legend.
savefig (boolean) – Determines if the figure is saved.
save_name (string) –
The inputted string will be appended to the name of the network.
Example
>>>import viswaternet as vis >>>model = vis.VisWNModel(r’Networks/Net3.inp’) … >>>model.save_fig(save_name=’_example’) <Net3_example.png>
color_bar_title (string) – The title of the color bar.
element_size_intervals (integer) – The number of intervals to be used if an element size legend is used.
element_size_legend_title (string) – The title of the element size legend.
element_size_legend_loc (string) – The location of the element size legend on the figure.
element_size_legend_labels (array-like) – The labels of each interval of the element size legend.
disable_interval_deleting – If True, empty intervals will be automatically deleted.
style (VisWaterNet Style Object) – The style object to be used.
viswaternet.drawing.style module
The viswaternet.drawing.style module contains the NetworkStyle object, which is used to define all the cosmetic options for VisWaterNet Plots. Styles can be created and modifed.
- param node_color:
Color of the draw_nodes.
- type node_color:
string
- param node_shape:
The shape of the nodes being drawn. Can either be a single string value or an array of values for each node being drawn.
- Refer to the matplotlib documentation for available marker types.
- type node_shape:
string, array-like
- param node_border_color:
The color of the node borders for the nodes being drawn. Can either be a single string value or an array of values for each node being drawn.
- type node_border_color:
string, array-like
- param node_border_width:
The width of the node borders. Can either be a single string value or an array of values for each node being drawn.
- type node_border_width:
integer, array-like
- param color_list:
The list of node colors for each interval. Both cmap and color_list can not be used at the same time to color draw_nodes. If both are, then color_list takes priority.
- type color_list:
string, array-like
- param link_width:
The width of the link being drawn. Can either be a single string value or an array of values for each link being drawn.
- type link_width:
string, array-like
- param link_style:
The style of the link being drawn. Can either be a single string value or an array of values for each link being drawn.
- Refer to the matplotlib documentation for available link styles.
https://matplotlib.org/stable/gallery/lines_bars_and_markers/linestyles.html
- type link_style:
string, array-like
- param link_arrows:
Whether arrows should be drawn for each link. Can either be a single string value or an array of values for each link being drawn.
- type link_arrows:
string, array-like
- param link_color:
The color the link being drawn. Can either be a single string value or an array of values for each link being drawn.
- type link_color:
string, array-like
- param draw_tanks:
Determines if draw_reservoirs with no data associated with them are drawn.
- type draw_tanks:
boolean
- param draw_reservoirs:
Determines if draw_reservoirs with no data associated with them are drawn.
- type draw_reservoirs:
boolean
- param draw_pumps:
Determines if draw_pumps with no data associated with them are drawn.
- type draw_pumps:
boolean
- param draw_valves:
Determines if draw_valves with no data associated with them are drawn.
- type draw_valves:
boolean
- param draw_links:
Determines if base draw_links with no data associated with them are drawn. Set to False for all functions that deal with link data plotting.
- type draw_links:
boolean
- param cmap:
The matplotlib color map to be used for plotting. Refer to matplotlib documentation for possible inputs.
- type cmap:
string
- param draw_base_legend:
Determine if the base elements legend is drawn.
- type draw_base_legend:
boolean
- param draw_discrete_legend:
Determine if the intervals legend is drawn.
- type draw_discrete_legend:
boolean
- param base_legend_loc:
The location of the base elements legend on the figure. Refer to matplotlib documentation for possible inputs.
- type base_legend_loc:
string
- param discrete_legend_loc:
The location of the intervals legend on the figure. Refer to matplotlib documentation for possible inputs.
- type discrete_legend_loc:
string
- param base_legend_label_font_size:
The font size of the non-title text for the base elements legend.
- type base_legend_label_font_size:
integer
- param base_legend_label_color:
The color of the legend text. Refer to matplotlib documentation for available colors.
- type base_legend_label_color:
string
- param discrete_legend_label_font_size:
The font size of the intervals legend text.
- type discrete_legend_label_font_size:
integer
- param discrete_legend_label_color:
The color of the intervals legend text.
- type discrete_legend_label_color:
string
- param discrete_legend_title_font_size:
The font size of the title text for the intervals legend.
- type discrete_legend_title_font_size:
integer
- param discrete_legend_title_color:
The color of the title tect for the intervals legend.
- type discrete_legend_title_color:
string
- param draw_legend_frame:
Determines if the frame around the legend is drawn.
- type draw_legend_frame:
boolean
- param legend_decimal_places:
The number of decimal places that will be used on the discrete legend.
- type legend_decimal_places:
integer
- param reservoir_size:
The size of the reservoir marker on the plot in points^2.
- type reservoir_size:
float
- param reservoir_color:
The color of the reservoir marker.
- type reservoir_color:
string
- param reservoir_shape:
The shape of the reservoir marker. Refer to matplotlib documentation for available marker types.
- type reservoir_shape:
string
- param reservoir_border_color:
The color of the border around the reservoir marker.
- type reservoir_border_color:
string
- param reservoir_border_width:
The width in points of the border around the reservoir marker.
- type reservoir_border_width:
float
- param tank_size:
The size of the tank marker on the plot in points^2.
- type tank_size:
float
- param tank_color:
The color of the tank marker.
- type tank_color:
string
- param tank_shape:
The shape of the tank marker. Refer to matplotlib documentation for available marker types.
- type tank_shape:
string
- param tank_border_color:
The color of the border around the tank marker.
- type tank_border_color:
string
- param tank_border_width:
The width in points of the border around the tank marker.
- type tank_border_width:
float
- param valve_elememt:
Determines whether the valves are drawn as links or nodes.
- type valve_elememt:
string
- param valve_size:
The size of the valve marker on the plot in points^2.
- type valve_size:
float
- param valve_color:
The color of the valve marker.
- type valve_color:
string
- param valve_shape:
The shape of the valve marker. Refer to matplotlib documentation for available marker types.
- type valve_shape:
string
- param valve_border_color:
The color of the border around the valve marker.
- type valve_border_color:
string
- param valve_border_width:
The width in points of the border around the valve marker.
- type valve_border_width:
float
- param valve_width:
The width of the valve line in points
- type valve_width:
float
- param valve_line_style:
The line style of valves if they are drawn as links. Refer to matplotlib documentation for available line styles.
- type valve_line_style:
string
- param valve_arrows:
Determines if an arrow is drawn in the direction of flow of the valves.
- type valve_arrows:
boolean
- param pump_element:
Determines if pumps are drawn as links or nodes.
- type pump_element:
string
- param pump_size:
The size of the pump marker on the plot in points^2.
- type pump_size:
float
- param pump_color:
The color of the pump line.
- type pump_color:
string
- param pump_shape:
The shape of the pump marker. Refer to matplotlib documentation for available marker types.
- type pump_shape:
string
- param pump_border_color:
The color of the border around the pump marker.
- type pump_border_color:
string
- param pump_border_width:
The width in points of the border around the pump marker.
- type pump_border_width:
float
- param pump_width:
The width of the pump line in points.
- type pump_width:
float
- param pump_line_style:
The style (solid, dashed, dotted, etc.) of the pump line. Refer to matplotlib documentation for available line styles.
- type pump_line_style:
string
- param pump_arrows:
Determines if an arrow is drawn in the direction of flow of the pump.
- type pump_arrows:
boolean
- param base_node_color:
The color of the nodes without data associated with them.
- type base_node_color:
string
- param base_node_size:
The size of the nodes without data associated with them in points^2.
- type base_node_size:
float
- param base_link_color:
The color of the links without data associated with them.
- type base_link_color:
string
- param base_link_width:
The width of the links without data associated with them in points.
- type base_link_width:
float
- param base_link_line_style:
The style (solid, dashed, dotted, etc) of the links with no data associated with them.
- type base_link_line_style:
string
- param base_link_arrows:
Determines if an arrow is drawn in the direction of flow of the links with no data associated with them.
- type base_link_arrows:
boolean
- param draw_color_bar:
Determines if color bar is drawn.
- type draw_color_bar:
boolean
- param color_bar_width:
The width of the color bar, measured in relative units of the total width of the plotting axis.
- type color_bar_width:
float
- param color_bar_height:
The height of the color bar, measured in relative units of the total height of the plotting axis.
- type color_bar_height:
float
- param color_bar_loc:
The location of the color bar. Can be ‘left’, ‘right’, ‘top’, or ‘bottom’.
- type color_bar_loc:
string
- param color_bar_label_loc:
The location of the color bar’s label relative to the color bar. Can be ‘left’, ‘right’, ‘top’, or ‘bottom’.
- type color_bar_label_loc:
string
- param color_bar_label_font_size:
The font size of the color bar’s label.
- type color_bar_label_font_size:
integer
- param color_bar_label_font_color:
The font color of the color bar’s label.
- type color_bar_label_font_color:
string
- param save_format:
The file format that the image will be saved to. A comprehensive list of formats can be found on the imageio docs page:
- type save_format:
string
- param dpi:
The DPI of the saved image. A higher DPI will result in images with a higher resolution.
- type dpi:
integer
Module contents
Created on Sun Oct 2 21:20:48 2022
@author: Tyler