Fix : set_ticklabels warning (#52)

* Fix set_ticklabels warning

* Update daily_plot.py

* Comment

* Update daily_plot.py
This commit is contained in:
Alexandre
2024-05-05 17:51:53 +02:00
committed by GitHub
parent ee9aeb6d62
commit 3045c5d8c1
+3
View File
@@ -98,6 +98,9 @@ def create_plot(df_plt_today, now, is_top=None):
# Try plot grid lines between bars - problem at the moment plots grid lines on bars - want between bars
yticklabels = ['\n'.join(textwrap.wrap(ticklabel.get_text(), 16)) for ticklabel in plot.get_yticklabels()]
# Next two lines avoid a UserWarning on set_ticklabels() requesting a fixed number of ticks
yticks = plot.get_yticks()
plot.set_yticks(yticks)
plot.set_yticklabels(yticklabels, fontsize=10)
plot.set(ylabel=None)
plot.set(xlabel="Detections")