Python#

The standard module for visualization in Python is Matplotlib. Matplotlib is a Python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms.

Matplotlib can be used in Python scripts, the Python and iPython shell (ala MATLAB®* or Mathematica®), web application servers, and six graphical user interface toolkits.

Matplotlib is free available: http://matplotlib.org/

For Python 3 Cartopy (https://pypi.org/project/Cartopy/), a cartographic python library with Matplotlib support for visualization, is used instead of Basemap.

How to use the example scripts at DKRZ#

On Levante you have to load the python3 module first:

module load python3

The module python3 includes the Matplotlib and Cartopy packages already.

Copy the example script you want to use to your work space. Not all example data sets are available but most files are stored in the folder

/work/kv0653/Python/data

Modify and execute the script:

python <script name>

For example

python matplotlib_contour_filled.py

Note

DKRZ has created a GitHub Python repository named PyEarthScience that contains Visualization, Analysis and IO example scripts. The sence of the repository is to establish a kind of a platform for Earth scientists for searching and representing Python scripts, tutorials, and packages using PyNGL/PYNIO, Matplotlib, Cartopy, Xarray, etc.

KMFleischer/PyEarthScience

Categories#

Maps

map resources, functions, sub-regions

XY-plots

1D data line plots, timeseries, scatter plots, statistics

Contours

2D data line, color fill (shaded), fill pattern, overlays

Vectors

2D vector data, e.g. wind components uv

Overlays

contour line on filled contour plot, vector on contours, different grid resolutions

Slices

draw contours longitudes/latitudes against time

Grids

rectilinear, curvilinear, unstructured grids

Axes

about Matplotlib axes

Special plots

miscellaneous plots

Shapefiles

work with shapefiles

Animations

scripts to generate animations

Colors, colormaps, colorbars

some specuals about colors

Miscellaneous

auxiliary scripts

Maps#

XY-plots#

Contours#

Vectors#

Overlays#

Slices#

Grids#

Axes#

Special plots#

Shapefiles#

Animations#

Colors, colormaps, colorbars#

Miscellaneous#