fix: drop NaN timestamps, use facecolor to suppress matplotlib warning

This commit is contained in:
张宗平
2026-06-11 22:17:27 +08:00
parent 404555ac0e
commit 817580ffe8
2 changed files with 11 additions and 2 deletions
+2 -2
View File
@@ -291,7 +291,7 @@ def render_column(
ax.plot(hours, values, color="#333333", linewidth=0.8, alpha=0.9)
if has_gt:
for start_h, end_h in gt_windows_h:
ax.axvspan(start_h, end_h, alpha=0.35, color="#FF4444",
ax.axvspan(start_h, end_h, alpha=0.35, facecolor="#FF4444",
edgecolor="#CC0000", linewidth=1.5)
# 异常点散点标记
anom_hours = [hours[i] for i, l in enumerate(gt_labels) if l == 1]
@@ -326,7 +326,7 @@ def render_column(
for wstart, wend in windows:
ws_h = (wstart - t0) / 3_600_000
we_h = (wend - t0) / 3_600_000
ax.axvspan(ws_h, we_h, alpha=0.4, color=color,
ax.axvspan(ws_h, we_h, alpha=0.4, facecolor=color,
edgecolor=color, linewidth=1.5)
det_hours_list.append((ws_h, we_h))