Skip to content
Snippets Groups Projects
Commit 57e75faa authored by Aaron Spring's avatar Aaron Spring
Browse files

bugfix

parent c5a68baf
No related branches found
No related tags found
No related merge requests found
......@@ -137,8 +137,8 @@ class CartopyMap(object):
print(
'use stereo maps and facet plots by:',
' fig,ax=plt.subplots(subplot_kw=',
f'{"projection":ccrs.NorthPolarStereo()}\n',
'd.isel(time=0).plot_map(proj=proj,ax=ax)'
'{"projection":ccrs.NorthPolarStereo()}\n',
'd.isel(time=0).plot_map(proj=proj,ax=ax)',
)
if single_plot:
axm = getattr(xda.plot, plot_type)(
......@@ -159,6 +159,15 @@ class CartopyMap(object):
else:
if round:
ax.set_boundary(circle, transform=ax.transAxes)
max_lat = 30
if isinstance(proj, ccrs.NorthPolarStereo):
ax.set_extent(
[-180, 180, max_lat, 90], crs=ccrs.PlateCarree()
)
elif isinstance(proj, ccrs.SouthPolarStereo):
ax.set_extent(
[-180, 180, -90, -max_lat], crs=ccrs.PlateCarree()
)
axm = getattr(xda.plot, plot_type)(
lon, lat, ax=ax, transform=ccrs.PlateCarree(), **kwargs
)
......
......@@ -60,7 +60,8 @@ def test_plot_map_projstr(da, projstr):
pytest.lazy_fixture('air_temperature_da'),
],
)
@pytest.mark.parametrize('projstr', ['NorthPolarStereo'])
@pytest.mark.parametrize('projstr', ['NorthPolarStereo','SouthPolarStereo','Stereographic'])
def test_plot_map_stereo(da, projstr):
fig, ax = plt.subplots(subplot_kw={'projection': ccrs.NorthPolarStereo()})
proj = eval(f'ccrs.{projstr}()')
fig, ax = plt.subplots(subplot_kw={'projection': proj})
da.isel(time=0).plot_map(proj=projstr, ax=ax)
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