Skip to content
Snippets Groups Projects
Commit 477a4031 authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Close plots to cleanup memory

parent fd88afd4
No related branches found
No related tags found
No related merge requests found
......@@ -179,12 +179,12 @@ class ZTPlot(kp.Module):
f = os.path.join(self.plots_path, filename + '.png')
f_tmp = os.path.join(self.plots_path, filename + '_tmp.png')
ztplot(hits,
filename=f_tmp,
title=title,
max_z=self.max_z,
ytick_distance=self.ytick_distance,
grid_lines=grid_lines)
fig = ztplot(hits,
filename=f_tmp,
title=title,
max_z=self.max_z,
ytick_distance=self.ytick_distance,
grid_lines=grid_lines)
shutil.move(f_tmp, f)
if overlays > self.records['overlays'] or n_hits > self.records[
......@@ -215,6 +215,9 @@ class ZTPlot(kp.Module):
])
shutil.copy(f, plot_filename)
plt.close(fig)
plt.close('all')
def finish(self):
self.run = False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment