Note
Go to the end to download the full example code.
Customise the 2D map projection#
This example shows how to customise the 2D map including the projection, the color map, which is used as the logo of this package.

/home/docs/checkouts/readthedocs.org/user_builds/cgeniepy/envs/latest/lib/python3.12/site-packages/cgeniepy/model.py:58: UserWarning: No gemflag is provided, use default gemflags: [biogem]
warnings.warn("No gemflag is provided, use default gemflags: [biogem]")
import cgeniepy
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
## Read in the model
model = cgeniepy.sample_model()
sst = model.get_var("ocn_sur_temp").isel(time=-1)
## use the Orthographic projection
## a full list of projections can be found at
## https://scitools.org.uk/cartopy/docs/latest/reference/projections.html#cartopy-projections
fig, ax = plt.subplots(subplot_kw={'projection': ccrs.Orthographic()})
## set the color map
sst_plotter= sst.to_GriddedDataVis()
sst_plotter.aes_dict['pcolormesh_kwargs']['cmap'] = plt.cm.inferno
sst_plotter.plot(ax=ax, outline=True)
plt.show()
Total running time of the script: (0 minutes 0.323 seconds)