contrib: add --title arg to plot-fees

This commit is contained in:
Ken Sedgwick 2026-02-03 12:00:16 -08:00
parent 12cd05db97
commit e050fc1dfd
No known key found for this signature in database
GPG key ID: DBD2AF0849D711A9
2 changed files with 12 additions and 3 deletions

View file

@ -81,7 +81,8 @@ how many days of earnings history are considered when ranking channels.
output. `--peer` accepts a nodeid, alias (via lightning-cli/listnodes), or
SCID (via lightning-cli/listpeerchannels). The combo view includes a daily
earnings panel (incoming/outgoing msat per day) when lightning-cli is
available.
available. Use `--title` to override the plot title (defaults to the peer
label; pass empty to omit).
- **`plot-aggregate`** plots aggregate percentile summaries from the
`fee-log-parser` sqlite output. Views include
`baseline-base`, `baseline-ppm`, `size`, `balance`, `theory`,

View file

@ -335,6 +335,13 @@ def add_common_args(parser):
action="store_true",
help="Show the plot interactively.",
)
parser.add_argument(
"--title",
nargs="?",
const="",
default=None,
help="Plot title (defaults to peer label; pass empty to omit).",
)
parser.add_argument(
"--since",
dest="from_ts",
@ -593,7 +600,7 @@ def plot_single_view(
fig, primary_ax, plot_axes = axes_factory(plt)
plotter(*plot_axes, rows, args.peer_label)
primary_ax.set_xlabel("time")
primary_ax.set_title(args.peer_label)
primary_ax.set_title(args.title)
if use_plt_tight_layout:
plt.tight_layout()
@ -1084,7 +1091,7 @@ def plot_combo(args):
if all_times:
ax_baseline.set_xlim(min(all_times), max(all_times))
fig.suptitle(args.peer_label)
fig.suptitle(args.title)
fig.tight_layout(rect=[0, 0, 1, 0.96])
fig.subplots_adjust(hspace=0.15)
@ -1127,6 +1134,7 @@ def main():
args.from_ts = parse_time_arg(args.from_ts)
args.to_ts = parse_time_arg(args.to_ts)
args.peer, args.peer_label = resolve_peer(args)
args.title = args.peer_label if args.title is None else args.title
if not args.png and not args.show and not args.csv:
raise SystemExit("use --png to save, --show to display, or --csv to export")