wntr.graphics.curve module

The wntr.graphics.curve module includes methods plot fragility curves and pump curves.

wntr.graphics.curve.plot_fragility_curve(FC, fill=True, key='Default', title='Fragility curve', xmin=0, xmax=1, npoints=100, xlabel='x', ylabel='Probability of exceeding a damage state', ax=None)[source]

Plot fragility curve.

Parameters
  • FC (wntr.scenario.FragilityCurve object) – Fragility curve

  • fill (bool, optional) – If true, fill area under the curve

  • key (string, optional) – Fragility curve state distribution key

  • title (string, optional) – Plot title

  • xmin (float, optional) – X axis minimum

  • xmax (float, optional) – X axis maximum

  • npoints (int, optional) – Number of points

  • xlabel (string, optional) – X axis label

  • ylabel (string, optional) – Y axis label

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

Returns

ax (matplotlib axes object)

wntr.graphics.curve.plot_pump_curve(pump, title='Pump curve', xmin=0, xmax=None, ymin=0, ymax=None, xlabel='Flow (m$^3$/s)', ylabel='Head (m)', ax=None)[source]

Plot points in the pump curve along with the pump curve polynomial using head curve coefficients (H = A - B*Q**C)

Parameters
  • pump (wntr.network.elements.Pump object) – Pump

  • title (string, optional) – Plot title

  • xmin (float, optional) – X axis minimum

  • xmax (float, optional) – X axis maximum

  • ymin (float, optional) – Y axis minimum

  • ymax (float, optional) – Y axis maximum

  • xlabel (string, optional) – X axis label

  • ylabel (string, optional) – Y axis label

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

Returns

ax (matplotlib axes object)

wntr.graphics.curve.plot_tank_volume_curve(tank, title='Tank volume curve', ax=None)[source]

Plots a tank volume curve and the corresponding axi-symmetric tank profile shape

Parameters
  • tank (wntr.network.elements.Tank object) – Tank

  • title (string, optional) – Plot title

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

Returns

ax (matplotlib axes object) – ax[0] is the left hand plot, ax[1] is the right hand plot