Note
Go to the end to download the full example code.
Plot 2D global map from the model output#
Here use the sea surface temperature as an example to plot the 2D global map from the model output.

/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 matplotlib.pyplot as plt
model = cgeniepy.sample_model()
sst = model.get_var("ocn_sur_temp").isel(time=-1)
## start to plot with customised cmap
sst_plotter = sst.to_GriddedDataVis()
sst_plotter.aes_dict['pcolormesh_kwargs']['cmap'] = plt.get_cmap("Spectral_r", 15)
sst_plotter.plot(colorbar=True, outline=True)
plt.show()
Total running time of the script: (0 minutes 0.559 seconds)