Swmm Plot
/install swmm-plot
SWMM Plot (publication spec)
Part of Agentic SWMM — install the project first for the executable toolchain (aiswmm CLI, SWMM solver, MCP servers).
Before calling plot — ask the user
When the user asks to plot, always ask these questions first before calling any plot tool:
- Which entity? A specific node (junction / outfall) — by name — or a specific link (conduit) — by name?
- List 3–5 high-peak-flow candidates from the run's RPT
Link Flow Summaryso the user can pick.
- List 3–5 high-peak-flow candidates from the run's RPT
- Which attribute? Node options:
Total_inflow,Depth_above_invert,Volume_stored_ponded,Flow_lost_flooding. Link options:Flow_rate,Velocity,Depth. - Time window? Default is the full simulation (24h). Offer to limit to a focus day or HH:MM-HH:MM window if peaks occur in a short period.
Do NOT silently pick defaults. The user needs control — different plots answer different questions (peak inspection vs continuity vs flooding).
What this skill provides
- A plotting script that reads:
- rainfall TIMESERIES from a SWMM
.inp(one named series at a time); - flow series from a SWMM
.outbinary (viaswmmtoolbox).
- rainfall TIMESERIES from a SWMM
- Renders a paired rainfall + node-flow figure with a fixed publication style:
- SI units (rain in mm per timestep or mm/h depending on
rainKind); - rainfall on the top axis, inverted (depth grows downward);
- flow on the bottom axis;
- inward ticks, Arial, no auto title;
- optional
focusDayto crop to a single day; optionalwindowStart/windowEnd(HH:MM, only together withfocusDay) for a sub-day window.
- SI units (rain in mm per timestep or mm/h depending on
When to use this skill
Use after swmm-runner.swmm_run has produced both .inp and .out, and you want a single rainfall-vs-flow figure for one node (typically the model's outfall or the assigned upstream junction of a subcatchment of interest).
Do not use this skill for multi-node ensemble plots, exceedance curves, or sensitivity scans — those would belong to swmm-uncertainty / swmm-calibration (no plot tools there yet).
MCP tools
This skill backs three LLM-facing tools. plot_rain_runoff_si is routed through the MCP server; inspect_plot_options and map_run are direct Python handlers in the tool registry (agentic_swmm/agent/tool_handlers/swmm_plot.py and swmm_map.py).
-
inspect_plot_options— inspect a run directory (or an explicit.inp/.outpath) and return the available rainfall series names, node IDs, and node output attributes. Call this beforeplot_runso you can pass real names instead of placeholders. Required args:run_dir(orinp_path+out_file). Read-only; auto-approved under the QUICK permission profile. -
map_run— render the spatial network layout (subcatchments + conduits + outfalls) as a PNG. Reads the INP from the run directory automatically; passinpto override. Required arg:run_dir. Optional:out_png,dpi,no_subcatchments,no_vertices. -
plot_run(proxies toplot_rain_runoff_sion the MCP server) — create a paired rainfall + node-flow figure from a run directory. Required arg:run_dir. Supply eithernodeorlink(mutually exclusive) to select the lower panel. Optional:rain_ts,rain_kind,node_attr,out_png. Day-window cropping: passfocus_day(YYYY-MM-DD) to crop the axis to one calendar day; passwindow_startandwindow_end(bothHH:MM) to further narrow to a sub-day window — both requirefocus_day(the server rejectswindow_start/window_endwithoutfocus_day).
mcp/swmm-plot/server.js exposes one underlying tool:
plot_rain_runoff_si— low-level render call used byplot_run. Preferplot_run(which acceptsrun_dir) over calling this directly.- Args:
inp(required): path to the SWMM .inp (the rainfall TIMESERIES is read from here).out(required): path to the SWMM .out binary.outPng(required): where to write the PNG.rainTs(no usable default — the schema ships the self-documenting placeholder\x3Crainfall-series-name>, which fails at render time if not replaced; always supply the actual series name from the .inp[TIMESERIES]section viainspect_plot_options): name of the rainfall TIMESERIES inside the .inp.rainKind(default"depth_mm_per_dt"): one ofintensity_mm_per_hr,depth_mm_per_dt,cumulative_depth_mm.dtMin(default5): timestep of the rainfall series in minutes.node(no usable default — the schema ships the self-documenting placeholder\x3Coutfall-or-junction>, which fails at render time if not replaced; always supply a real outfall or junction name viainspect_plot_options): node ID to plot from the .out.nodeAttr(default"Total_inflow"): whichswmmtoolboxattribute (e.g.Total_inflow,Lateral_inflow,Flow_lost_flooding).dpi(default300).focusDay(optional,YYYY-MM-DD): crop axis to a single day plus padding.windowStart/windowEnd(optional,HH:MM; only valid together withfocusDay): sub-day time window within the focus day. Rejected with a clear error if used withoutfocusDay.padHours(default2).
- Args:
Recommended orchestration
inspect_plot_options → list available series + node names
swmm-runner.run_swmm_inp → model.inp + model.out
plot_run → outfall_flow.png (or junction_flow.png)
Call inspect_plot_options first to get the real rainfall series name and outfall node name, then pass those to plot_run. If multiple nodes need to be plotted, call plot_run once per node with a different out_png path.
Conventions
- Strict publication style: do not write a title in the plot; titles belong to the surrounding document.
- SI units only.
- Rainfall axis is always inverted; depth grows downward so it doesn't overlap the flow series visually.
Known limitations
- Only one rainfall series is plotted at a time (
rainTsis a single name); multi-gauge inputs need separate figures.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install swmm-plot - 安装完成后,直接呼叫该 Skill 的名称或使用
/swmm-plot触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Swmm Plot 是什么?
Publication-grade plotting for SWMM rainfall–runoff time-series figures. Use when an agent needs to produce a paired rainfall (top, inverted) + node flow (bo... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 38 次。
如何安装 Swmm Plot?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install swmm-plot」即可一键安装,无需额外配置。
Swmm Plot 是免费的吗?
是的,Swmm Plot 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Swmm Plot 支持哪些平台?
Swmm Plot 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Swmm Plot?
由 Zhonghao Zhang(@zhonghao1995)开发并维护,当前版本 v0.7.3。