Skip to content

Commit

Permalink
added plt.close statements to wave and map maker to explicitely close…
Browse files Browse the repository at this point in the history
… unshown figures to avoid matplotlib warning about memory-consuming open figures
  • Loading branch information
bch0w committed Mar 1, 2023
1 parent 6bcc149 commit 3e0dbbc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyatoa/visuals/map_maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ def plot(self, show=True, save=None, **kwargs):
plt.savefig(save)
if show:
plt.show()
else:
plt.close()


def scale_bar(ax, length=None, location=(0.85, 0.95), linewidth=3,
Expand Down
2 changes: 2 additions & 0 deletions pyatoa/visuals/wave_maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,8 @@ def plot(self, show=True, save=False, **kwargs):
plt.savefig(save)
if show:
plt.show()
else:
plt.close()


def align_yaxes(ax1, ax2):
Expand Down

0 comments on commit 3e0dbbc

Please sign in to comment.