Plotting Reference: Profiles
Rendered from 15_all_plot_functions.ipynb.
m.plot_profile
| Public API | Path selector input | Behavior |
|---|---|---|
m.plot_profile.nodes(start_node, end_node, ...) | Existing start/end node IDs | Find a directed hydraulic path between nodes, then plot it. |
m.plot_profile.links(ids, ...) | One ordered link ID or list of link IDs | Validate connected order in either direction, then plot exactly that sequence. |
m.plot_profile.longest(...) | No path selector | Find the longest directed conduit path and plot it. |
Profile inputs
Profiles use directed conduit connectivity, node invert elevations, conduit lengths, and conduit full depths. Ground elevation is approximated from node invert plus max depth when needed. EGL is currently not exposed by the result layer, so requesting show_egl=True emits a warning and skips that overlay.
| Input | Type | Default | Meaning |
|---|---|---|---|
time_step | int | -1 | Result row index for overlay variables; -1 means last row. |
aggregation | `str \ | None` | None |
legend | bool | True | Show profile legend. |
grid | bool | True | Show grid lines. |
title | `str \ | None` | None |
legend_title | `str \ | None` | None |
axis | bool | True | Show axes and ticks. |
x_axis_title | `str \ | None` | None |
y_axis_title | `str \ | None` | None |
save_format | `str \ | None` | None |
save_path | `str \ | Path \ | None` |
figsize | tuple[float, float] | (12, 5) | Figure size when ax is not supplied. |
dpi | int | 300 | Figure resolution. |
ax | matplotlib `Axes \ | None` | None |
show | bool | True | Call plt.show() after rendering. |
unit_length, unit_elevation | `str \ | None` | None |
show_ground | bool | True | Draw approximated ground line. |
show_conduits | bool | True | Draw conduit barrels. |
show_invert | bool | True | Draw node invert line. |
show_crown | bool | True | Draw conduit crown line. |
show_hgl | bool | False | Draw hydraulic grade line; requires results. |
show_egl | bool | False | Request energy grade line; currently warns and skips because EGL is not exposed. |
show_water_depth | bool | False | Draw water level; requires results. |
show_node_labels | bool | True | Annotate nodes. |
show_link_labels | bool | True | Annotate links on their conduit barrels. |
show_node_guides | bool | True | Draw prominent vertical dotted lines at node locations. |
show_surcharge | bool | True | Mark surcharge locations when results are available. |
show_flooding | bool | True | Mark flooding locations when results are available. |
fill_conduits | bool | True | Shade conduit barrels between invert and crown. |
line_styles | `dict[str, str] \ | None` | None |
colors | `dict[str, str] \ | None` | None |
Profile examples
m.plot_profile.nodes('J1', 'OUT1', show_hgl=True, aggregation='max')
m.plot_profile.links(['C1', 'C2', 'C3']) # connected walks may follow or oppose hydraulic direction
m.plot_profile.longest(show_hgl=True, aggregation='max')
fig, ax = m.plot_profile.longest(
show_hgl=True,
aggregation='max',
title='Longest path profile',
show=False,
save_path=output_dir / 'notebook_profile_example.png',
)
plt.close(fig)