Skip to main content

A suite of tools for creating maps in matplotlib

Project description

matplotlib_map_utils logo


Documentation: Available at https://moss-xyz.github.io/matplotlib-map-utils/

Source Code: Available on GitHub

Feedback: I welcome any and all feedback! See the Development Notes below for more details.

Current Version: v4.1.1, which fixed a a few bugs (see here for details!)


👋 Introduction

matplotlib_map_utils is a package that that assists with the creation of maps using matplotlib.

As of v4.x (the current version), this includes the ability to easily create three common map elements:

  • North arrows, which automatically point to true north,

  • Scale bars, available in different styles and automatic unit conversion, and

  • Inset maps, including both detail and extent-style plots.

The three elements listed above are all intended to be high-resolution, easily modifiable, and context-aware relative to your specific plot.

This package also contains a single utility object:

  • USA, a class that helps filter for states and territories within the USA based on given characteristics, used primarily for building queries based on FIPS codes or names.

Together, these allow for the (relatively) easy creation of a map such as the following:

Map with all common elements added


💾 Installation

This package is available on PyPi, and can be installed like so:

pip install matplotlib-map-utils
# or
uv add matplotlib-map-utils

The requirements for this package are:

  • python >= 3.10 (due to the use of the pipe operator to concatenate dictionaries and types)

  • matplotlib >= 3.9 (might work with lower versions but not guaranteed)

  • cartopy >= 0.23 (due to earlier bug with calling copy() on CRS objects)

  • pydantic >= 2.13.3 (for type validation; might work with older versions, open an issue if you have questions)


Quick Start and Usage Guides

For a primer on how to import the package and use the primary functions and methods to create elements, see the Quick Start guide.

Each part of the package also has a dedicated page that lays out usage and customisation options in more detail:

Finally, the Package Information page provides additional context around the development of and overall structure of the package.


Support and Contributions

If you notice something is not working as intended or if you'd like to add a feature yourself, I welcome PRs - just be sure to be descriptive as to what you are changing and why, including code examples!

If you are having issues using this script, feel free to leave a post explaining your issue, and I will try and assist, though I have no guaranteed SLAs as this is just a hobby project.

I am open to contributions, especially to help tackle the roadmap above!


⚖️ License

I know nothing about licensing, so I went with the GPL license. If that is incompatible with any of the dependencies, please let me know.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

matplotlib_map_utils-4.1.1.tar.gz (101.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

matplotlib_map_utils-4.1.1-py3-none-any.whl (86.4 kB view details)

Uploaded Python 3

File details

Details for the file matplotlib_map_utils-4.1.1.tar.gz.

File metadata

  • Download URL: matplotlib_map_utils-4.1.1.tar.gz
  • Upload date:
  • Size: 101.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for matplotlib_map_utils-4.1.1.tar.gz
Algorithm Hash digest
SHA256 f5d01953ba217e206b212a2e41e4624912d16f96d79747e26987a664568cbf28
MD5 b26f064fc2e1cb93d7230a8e30e4d5a8
BLAKE2b-256 133e1151d2f2bbca5c3ba61f2fe968e0b473202aa53303b88fd0179829edb018

See more details on using hashes here.

File details

Details for the file matplotlib_map_utils-4.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for matplotlib_map_utils-4.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ee4eacb57300affb1dc518e379acdaae791ed198d659b0bc54b0c236dab7ff5c
MD5 b8989cd30fb2817a2b2ea829e3db473e
BLAKE2b-256 6e138105f24729e92f1741b3e8b39e2da4d6b5f85d1e224e59691350407b7b09

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page