GrafeasGroup / buttercup

Our personal assistant in Discord
MIT License
5 stars 2 forks source link

Properly close pyplot figures #151

Closed TimJentzsch closed 2 years ago

TimJentzsch commented 2 years ago
 Dec 27 19:45:43 localhost python[17391]: /data/buttercup/buttercup/cogs/heatmap.py:45: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
Dec 27 19:45:43 localhost python[17391]:   fig, ax = plt.subplots()
itsthejoker commented 2 years ago

Can you do this with a context manager? with plot() as plot or something like that?