In [ ]:
%matplotlib inline
%config InlineBackend.figure_format = "retina"
from matplotlib import rcParams
rcParams["savefig.dpi"] = 200
rcParams["font.size"] = 8
import warnings
warnings.filterwarnings("ignore")
Import regionmask and check the version:
In [ ]:
import regionmask
regionmask.__version__
In [ ]:
regionmask.defined_regions.srex.plot();
In [ ]:
# load cartopy
import cartopy.crs as ccrs
# regions can be selected by number, abbreviation or long name
regions = [11, "CEU", "S. Europe/Mediterranean"]
# choose a good projection for regional maps
proj = ccrs.LambertConformal(central_longitude=15)
# do the plot
ax = regionmask.defined_regions.srex.plot(
regions=regions, add_ocean=True, resolution="50m", proj=proj, label="abbrev"
)
# fine tune the extent
ax.set_extent([-15, 45, 28, 76], crs=ccrs.PlateCarree())
In [ ]:
regionmask.defined_regions.srex.plot_regions();
To achieve this, you need to explicitely create the axes:
In [ ]:
import matplotlib.pyplot as plt
f, ax = plt.subplots(subplot_kw=dict(projection=ccrs.PlateCarree()))
regionmask.defined_regions.srex.plot_regions(ax=ax, line_kws=dict(lw=1));