stats: Set history line alpha to 1 if no averages being plotted

pull/1/head
Michael DM Dryden 2020-06-05 02:43:30 -04:00
rodzic 97ef0b27d8
commit fe35413e36
1 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -444,10 +444,13 @@ class StatsRunner(object):
averages = 0
if averages:
df['msg_rolling'] = df['messages'].rolling(averages, center=True).mean()
alpha = 0.5
else:
alpha = 1
fig = Figure() # TODO: One day pandas will let you use constrained_layout=True here...
subplot = fig.subplots()
df.plot(x='day', y='messages', alpha=0.5, legend=False, ax=subplot)
df.plot(x='day', y='messages', alpha=alpha, legend=False, ax=subplot)
if averages:
df.plot(x='day', y='msg_rolling', legend=False, ax=subplot)
subplot.set_ylabel("Messages")