Skip to content

Commit e29c6ba

Browse files
committed
WIP; fix axis overwriting
1 parent 22f3768 commit e29c6ba

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

trajan/waves/plot.py

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,6 @@ class Plot:
2121

2222
def __init__(self, ds):
2323
self.ds = ds
24-
self.gcrs = ccrs.PlateCarree()
25-
26-
def set_up_map(self, **kwargs):
27-
"""
28-
Set up axes for plotting.
29-
30-
Args:
31-
32-
ax: An existing axes to use.
33-
34-
Returns:
35-
36-
An matplotlib axes with a Cartopy projection.
37-
38-
"""
39-
ax = kwargs.get('ax', plt.axes())
40-
return ax
4124

4225
def __call__(self, *args, **kwargs):
4326
if self.ds.attrs['standard_name'] == 'sea_surface_wave_variance_spectral_density':
@@ -69,8 +52,10 @@ def spectra(self, time, *args, **kwargs):
6952
"""
7053
vrange = kwargs.pop('vrange', None)
7154
nseconds_gap = kwargs.pop('nseconds_gap', 6 * 3600)
72-
73-
ax = self.set_up_map(**kwargs)
55+
try:
56+
ax = kwargs.pop('ax')
57+
except:
58+
ax = plt.axes()
7459

7560
if vrange is None:
7661
vmin_pcolor = -3.0

0 commit comments

Comments
 (0)