chiark
/
gitweb
/
~cjwatson
/
blog.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f09b5c0
)
m.plots: matplotlib otherwise keeps everything in memory.
author
Vladimír Vondruš
<mosra@centrum.cz>
Wed, 16 May 2018 10:31:41 +0000
(12:31 +0200)
committer
Vladimír Vondruš
<mosra@centrum.cz>
Wed, 16 May 2018 10:31:41 +0000
(12:31 +0200)
Huh.
pelican-plugins/m/plots.py
patch
|
blob
|
history
diff --git
a/pelican-plugins/m/plots.py
b/pelican-plugins/m/plots.py
index 173ca76de1d324d5d4e4a602f8fe66c1bbe50bea..1d09cf97239e3429f5091b22e1b8f7f168121c8e 100644
(file)
--- a/
pelican-plugins/m/plots.py
+++ b/
pelican-plugins/m/plots.py
@@
-214,6
+214,7
@@
class Plot(rst.Directive):
fig.patch.set_visible(False) # hide the white background
imgdata = io.StringIO()
fig.savefig(imgdata, format='svg')
+ plt.close() # otherwise it consumes a lot of memory in autoreload mode
# Patch the rendered output: remove preable and hardcoded size
imgdata = _patch_src.sub(_patch_dst, imgdata.getvalue())