A live bird collage card for your Home Assistant dashboard.
fix daily_plot could show zeros when max count/h is only one
frederik23a35a289c02
diff --git a/scripts/daily_plot.py b/scripts/daily_plot.pyindex e5cceb2b..5e3ac851 100755--- a/scripts/daily_plot.py+++ b/scripts/daily_plot.py@@ -7,6 +7,7 @@ from time import sleepimport matplotlib.font_manager as font_managerimport matplotlib.pyplot as plt+import numpy as npimport pandas as pdimport seaborn as snsfrom matplotlib import rcParams@@ -88,6 +89,8 @@ def create_plot(df_plt_today, now, is_top):hours_in_day = pd.Series(data=range(0, 24))heat_frame = pd.DataFrame(data=0, index=heat.index, columns=hours_in_day)heat = (heat+heat_frame).fillna(0)+ # mask out zeros, so they do not show up in the final plot. this happens when max count/h is one+ heat[heat == 0] = np.nan# Generatie heatmap plotplot = sns.heatmap(heat, norm=LogNorm(), annot=True, annot_kws={"fontsize": 7}, fmt="g", cmap=pal, square=False,