Metadata-Version: 2.4
Name: mplotutils
Version: 0.7.0
Summary: utilities for matplotlib and cartopy
Author-email: mplotutils developers <mathias.hauser@env.ethz.com>
License-Expression: GPL-3.0-only
Project-URL: Homepage, https://github.com/mpytools/mplotutils
Project-URL: Documentation, https://github.com/mpytools/mplotutils
Project-URL: Source, https://github.com/mpytools/mplotutils
Project-URL: BugReports, https://github.com/mpytools/mplotutils/issues
Keywords: matplotlib cartopy plotting
Classifier: Development Status :: 5 - Production/Stable
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
Classifier: Topic :: Scientific/Engineering :: GIS
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cartopy>=0.23
Requires-Dist: matplotlib>=3.9
Requires-Dist: numpy>=1.26
Requires-Dist: packaging>=23.1
Requires-Dist: shapely>=2.0
Requires-Dist: xarray>=2024.7
Provides-Extra: full
Requires-Dist: seaborn; extra == "full"
Dynamic: license-file

# 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
:-------------------------:|:-------------------------:
<img src="docs/example_no_mpu.png" alt="Without mplotutils" width="250"/> | <img src="docs/example_mpu.png" alt="With mplotutils" width="250"/>

The code to create the examples can be found in [docs/example.py](docs/example.py).


**axes_grid**

Matplotlib's [axes_grid](https://matplotlib.org/stable/users/explain/toolkits/axes_grid.html) 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 |
| :--------------------------------: | :-------------------------: |
| <img src="docs/example_axes_grid_no_mpu.png" alt="Without mplotutils" width="250"/> | <img src="docs/example_axes_grid_mpu.png" alt="With mplotutils" width="250"/> |

The code to create the example can be found in [docs/example_axes_grid.py](docs/example_axes_grid.py).

## hatching

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

<img src="docs/example_hatch.png" alt="mplotutils hatching" width="350"/>

The code to create the example can be found in [docs/example_hatch.py](docs/example_hatch.py).

## Installation

See [docs/installation.md](docs/installation.md).

## Changelog

See [CHANGELOG.md](CHANGELOG.md).

## History

This package bases on functions developed for the [python visualisation workshop at C2SM](https://github.com/C2SM/pyvis/).
