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.0.0, featuring a brand-new documentation site!


👋 Introduction

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

As of v3.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)


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.0.0.tar.gz (104.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.0.0-py3-none-any.whl (89.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: matplotlib_map_utils-4.0.0.tar.gz
  • Upload date:
  • Size: 104.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.0.0.tar.gz
Algorithm Hash digest
SHA256 37dc4cfe5e0177153737c3ecf953a52554220ec6eeb56de650b7343d53184056
MD5 da9386e978071e5ee5f9f7a773c47a0f
BLAKE2b-256 7308a3b729a8dfc638bf5d37de44f47e33128014288c39b25c982f798ad1de7e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for matplotlib_map_utils-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 32f417cdae3afe1c6b8b24233b798b197d60fcfb19cc4db15431b2f583c94942
MD5 e84e46eda3aa5c72d72c530b2d7ccae2
BLAKE2b-256 b0efdcd97d8a95a01096173ff64884032a6b9a23e690bfdeb3986eb57e760e94

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