viswaternet.drawing package

Submodules

viswaternet.drawing.animate module

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.

  • 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.animate.bbox_inches_tight_resize(fig)[source]
viswaternet.drawing.animate.make_intervals(parameter, kwargs)[source]
viswaternet.drawing.animate.make_vmin_vmax(parameter, kwargs)[source]

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.

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.

  • cmap (string) – The matplotlib color map to be used for plotting. Refer to matplotlib documentation for possible inputs.

  • color_bar_title (string) – The title of the color bar.

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) –

  • label_edge_color (string) –

  • label_alpha (integer) –

  • label_font_style (string) –

  • label_edge_width (integer) –

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 a 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.

  • node_border_color (string) – The color of the legend draw_nodes edges when plotting element size legend.

  • linewidths (integer) – The width of the line of the legend draw_nodes when plotting element size legend.

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.

  • vmin (integer) – The minimum value of the color bar.

  • vmax (integer) – The maximum value of the color bar.

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.

  • vmin (integer) – The minimum value of the color bar.

  • vmax (integer) – The maximum value of the color bar.

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>

viswaternet.drawing.continuous module

The viswaternet.drawing.continuous module handles everything related to continuous data drawing.

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>

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>

viswaternet.drawing.discrete module

The viswaternet.drawing.discrete module handles everything related to discrete data drawing.

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.

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>

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.

  • 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>

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.

  • 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.

  • 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.

  • node_size (integer, array-like) – List of node sizes for each interval.

  • node_shape (string, array-like) – List of node shapes for each interval. Refer to matplotlib documentation for available marker types.

  • link_width (integer, array-like) – List of link widths for each interval.

  • label_list (string, array-like) – List of labels for each interval.

  • node_border_color (string, array-like) – The color of the node borders for each interval.

  • node_border_width (integer, array-like) – The width of the node borders for each interval.

  • 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.

  • vmin (integer) – The minimum value of the color bar.

  • vmax (integer) – The maximum value of the color bar.

  • link_style (string) – The style (solid, dashed, dotted, etc.) of the draw_links. Refer to matplotlib documentation for available line styles.

  • link_arrows (boolean) – Determines if an arrow is drawn in the direction of flow of the pump.

  • draw_reservoirs (boolean) – Determines if draw_reservoirs with no data associated with them are drawn.

  • draw_tanks (boolean) – Determines if draw_reservoirs with no data associated with them are drawn.

  • draw_pumps (boolean) – Determines if draw_pumps with no data associated with them are drawn.

  • draw_valves (boolean) – Determines if draw_valves with no data associated with them are drawn.

  • draw_links (boolean) – Determines if draw_links with no data associated with them are drawn.

  • draw_nodes (boolean) – Determines if draw_nodes with no data associated with them are drawn.

  • draw_base_legend (boolean) – Determines if the base elements legend will be drawn.

  • legend_title (string) – Title of the intervals legend.

  • base_legend_loc (string) – The location of the base elements legend on the figure. Refer to matplotlib documentation for possible inputs.

  • base_legend_label_font_size (integer) – The font size of the non-title text for the base elements legend.

  • base_legend_label_color (string) – The color of the base elements legend text. Refer to matplotlib documentation for available colors.

  • draw_discrete_legend (boolean) – Determine if the intervals legend is drawn.

  • discrete_legend_loc (string) – The location of the intervals legend on the figure.

  • discrete_legend_label_font_size (integer) – The font size of the non-title text for the intervals legend.

  • discrete_legend_label_color (string) – The color of the intervals legend text. Refer to matplotlib documentation for available colors.

  • discrete_legend_title_font_size (integer) – The font size of the title text for the intervals legend.

  • discrete_legend_title_color (string) – The color of the intervals legend title text.

  • draw_legend_frame (boolean) – Determines if the frame around the legend is drawn.

  • legend_decimal_places (integer) – The number of significant figures, or decimal points, that numbers in the legend will be displayed with. 0 should be passed for whole numbers.

  • 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.

  • reservoir_size (integer) – The size of the reservoir marker on the plot in points^2.

  • reservoir_color (string) – The color of the reservoir marker.

  • reservoir_shape (string) – The shape of the reservoir marker. Refer to matplotlib documentation for available marker types.

  • reservoir_border_color (string) – The color of the border around the reservoir marker.

  • reservoir_border_width (integer) – The width in points of the border around the reservoir marker.

  • tank_size (integer) – The size of the tank marker on the plot in points^2.

  • tank_color (string) – The color of the tank marker.

  • tank_shape (string) – The shape of the tank marker.

  • tank_border_color (string) – The color of the border around the tank marker.

  • tank_border_width (integer) – The width in points of the border around the tank marker.

  • valve_element (string) – Determines if valves are drawn as nodes or links.

  • valve_size (integer) – The size of the valve marker on the plot in points^2.

  • valve_color (string) – The color of the valve marker.

  • valve_shape (string) – The shape of the valve marker.

  • valve_border_color (string) – The color of the border around the valve marker.

  • valve_border_width (integer) – The width in points of the border around the valve marker.

  • valve_width (integer) – The width of the valve line in points.

  • valve_line_style (string) – The style (solid, dashed, dotted, etc.) of the valve line. Refer to matplotlib documentation for available line styles.

  • valve_arrows (boolean) – Determines if an arrow is drawn in the direction of flow of the valves.

  • pump_element (string) – Determines if pumps are drawn as links or nodes.

  • pump_size (integer) – The size of the pump marker on the plot in points^2.

  • pump_color (string) – The color of the pump line.

  • pump_shape (string) – The shape of the pump marker.

  • pump_border_color (string) – The color of the border around the pump marker.

  • pump_border_width (integer) – The width in points of the border around the pump marker.

  • pump_width (integer) – The width of the pump line in points.

  • pump_line_style (string) – The style (solid, dashed, dotted, etc.) of the pump line. Refer to matplotlib documentation for available line styles.

  • pump_arrows (boolean) – Determines if an arrow is drawn in the direction of flow of the pump.

  • base_node_color (string) – The color of the draw_nodes without data associated with them.

  • base_node_size (integer) – The size of the draw_nodes without data associated with them in points^2.

  • base_link_color (string) – The color of the draw_links without data associated with them.

  • base_link_width (integer) – The width of the draw_links without data associated with them in points.

  • base_link_line_style (string) – The style (solid, dashed, dotted, etc) of the draw_links with no data associated with them.

  • base_link_arrows (boolean) – Determines if an arrow is drawn in the direction of flow of the draw_links with no data associated with them.

  • draw_color_bar (boolean) – Determines if color bar is drawn.

  • color_bar_width (integer) – The width of the color bar.

  • color_bar_title (string) – The title of the color bar.

  • color_bar_height (integer) – The height 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>

  • dpi (int, string) – The dpi that the figure will be saved with.

  • save_format (string) – The file format that the figure will be saved as.

Module contents

Created on Sun Oct 2 21:20:48 2022

@author: Tyler