Skip to content

mpytools/mplotutils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

323594c · Dec 4, 2024
Dec 4, 2024
Oct 31, 2024
Dec 4, 2024
Jan 15, 2023
Dec 3, 2024
Nov 30, 2022
Nov 30, 2022
Nov 30, 2022
Mar 7, 2018
Oct 15, 2024
Dec 4, 2024
Jan 15, 2023
Oct 31, 2024
May 30, 2024
Oct 18, 2024
Dec 3, 2024
Nov 30, 2022

Repository files navigation

mplotutils

helper functions for cartopy and matplotlib

fix layout for cartopy axes and colorbars

This package solves two main problems for plots with maps created with cartopy. Because these plots have a fixed aspect ratio (1) colorbars will extend beyond the visible axes and (2) the distance between individual subplots will seemingly be random.

subplots

Without mplotutils With mplotutils
Without mplotutils With mplotutils

The code to create the examples can be found in docs/example.py.

axes_grid

Matplotlib's axes_grid can also display data with a fixed aspect ratio. However, the size of the figure will not be correct. mplotutils (from version 0.6) can also help with this

Axes grid - without mplotutils Axes grid - with mplotutils
Without mplotutils With mplotutils

The code to create the example can be found in docs/example_axes_grid.py.

hatching

mplotutils (from version 0.6) includes helper functions to draw hatches and add stippling:

mplotutils hatching

The code to create the example can be found in docs/example_hatch.py.

Installation

See docs/installation.md.

Changelog

See CHANGELOG.md.

History

This package bases on functions developed for the python visualisation workshop at C2SM.