Skip to content

Commit

Permalink
moved plt close statements into manager because it was prematurely cl…
Browse files Browse the repository at this point in the history
…osing figures for the 'both' option
  • Loading branch information
bch0w committed Mar 1, 2023
1 parent 3e0dbbc commit abb9bd4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 4 additions & 2 deletions pyatoa/core/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"""
import os
import obspy
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pyflex
import pyadjoint
Expand Down Expand Up @@ -1245,15 +1247,15 @@ def plot(self, choice="both", save=None, show=True, corners=None,
if choice == "wav":
wm = WaveMaker(mgmt=self, **kwargs)
wm.plot(show=show, save=save)
plt.close()
# Plot only map
elif choice == "map":
mm = MapMaker(inv=self.inv, cat=self.event, corners=corners,
**kwargs)
mm.plot(show=show, save=save)
plt.close()
# Plot waveform and map on the same figure
elif choice == "both":
import matplotlib as mpl
import matplotlib.pyplot as plt

if figsize is None:
figsize = (1400 / dpi, 600 / dpi)
Expand Down
2 changes: 0 additions & 2 deletions pyatoa/visuals/map_maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,6 @@ 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: 0 additions & 2 deletions pyatoa/visuals/wave_maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,8 +690,6 @@ 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 abb9bd4

Please sign in to comment.