Skip to content

Commit

Permalink
Merge pull request #587 from akrherz/231114
Browse files Browse the repository at this point in the history
feat: add 30y trailing
  • Loading branch information
akrherz authored Nov 15, 2023
2 parents b928ce9 + a24bfbd commit 1ca99a2
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion htdocs/plotting/auto/scripts/p10.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,13 @@ def plotter(fdict):
f"{(s_r**2):.2f}"
),
)
ax.plot(
years,
df["spring"].rolling(window=30).mean(),
color="purple",
lw=3,
label="30yr",
)
ax.plot(
years,
years * f_slp + f_int,
Expand All @@ -222,13 +229,21 @@ def plotter(fdict):
f"{(f_r**2):.2f}"
),
)
ax.plot(
years,
df["fall"].rolling(window=30).mean(),
color="r",
lw=3,
label="30yr",
)

ax.grid(True)
title = PDICT.get(direction, "").replace(
"Temperature", PDICT2.get(varname)
)
units = r"$^\circ$F" if not varname.startswith("snow") else "inch"
ax.set_title(f"{ctx['_sname']}\n{title} {threshold}{units}")
ax.legend(ncol=2, fontsize=14, labelspacing=2)
ax.legend(ncol=4, fontsize=14, labelspacing=2)
ax.set_yticks((1, 32, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335))
ax.set_yticklabels(calendar.month_abbr[1:])
ax.set_ylim(min(spring) - 5, max(fall) + 30)
Expand Down

0 comments on commit 1ca99a2

Please sign in to comment.