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.0, featuring a brand-new documentation site and improved type validation! This DID introduce some breaking changes, see the documentation site 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.0.tar.gz (99.3 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.0-py3-none-any.whl (84.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: matplotlib_map_utils-4.1.0.tar.gz
  • Upload date:
  • Size: 99.3 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.0.tar.gz
Algorithm Hash digest
SHA256 6e96b6ec07a1bcf29cfedc7eb512d3d8712e5c53062a4f2614f314941e119ccd
MD5 22e712cd868ef6cc2dd6439533a3ccc9
BLAKE2b-256 67ecf7b4b829d31acc5d4fe7cea96b7ef3dae52a5fa5029907411cf2c155d376

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for matplotlib_map_utils-4.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d030420bc33b15984fed3a1adf06e82c07ea41ac8307a7c8dc1da09da0f158c5
MD5 625f3ab7f021c3fb26733828168304f6
BLAKE2b-256 412247c92235496c97edb205b5520a0f1e0c4e37e2576b1944e3f71d0c68084f

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