Figure with several subplots (a.k.a. axes)ΒΆ

[1]:
%matplotlib inline
# for figures in notebook

# import & initialize epygram
import epygram
epygram.init_env()

import os
INPUTS_DIR = os.path.join('..', 'inputs')
[2]:
r = epygram.formats.resource(os.path.join(INPUTS_DIR, 'ic.full-surfex.corsica-02km50.fa'), 'r')
[3]:
tg = r.readfield('X001TG1')
ts = r.readfield('SFX.SST')
[4]:
from matplotlib.pyplot import figure
fig = figure(figsize=(10,5))
# in this case the projection needs to be specified early on
from cartopy import crs as ccrs
ax1 = fig.add_subplot(1, 2, 1, projection=tg.geometry.default_cartopy_CRS())
ax2 = fig.add_subplot(1, 2, 2, projection=ccrs.NorthPolarStereo())
# then plot
tg.cartoplot(fig=fig, ax=ax1)
ts.cartoplot(fig=fig, ax=ax2)
[4]:
(<Figure size 720x360 with 4 Axes>,
 <GeoAxesSubplot:title={'center':'SFX.SST\n2019-01-01 00:00:00'}>)
../../_images/gallery_A.1-H2D_plots_03.figure_and_axes_4_1.png
[ ]: