descartes
Use geometric objects as matplotlib paths and patches
What it is and what it does
Descartes is an adapter layer that converts geometric objects and GeoJSON-like dictionaries into matplotlib patch objects for visualization. It bridges geometric computation and matplotlib's rendering system, allowing you to plot spatial data directly without manual coordinate extraction. The package accepts objects with a `__geo_interface__` property or compatible geometric structures and converts them into matplotlib patches that can be added to axes.
The package is stable and has been in production use since 2010, but it is no longer actively maintained—the last release was in 2017. It has no known security vulnerabilities and carries a permissive BSD license. Its single runtime dependency is matplotlib, with numpy as an implicit requirement.
Use it for:
- Plot geometric objects directly on matplotlib figures without manual coordinate extraction.
- Visualize GeoJSON geometries in Python by converting them to matplotlib patches for display.
- Create spatial plots where you want to leverage geometric operations and matplotlib's rendering.
- Render transformed geometries as colored patches with transparency and styling.
- Build exploratory plots of spatial data without writing custom coordinate-to-patch conversion code.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts geometric objects and GeoJSON-like data into matplotlib patches and paths for visualization on plots.
Yes, if you are working with geometric objects and matplotlib in a stable codebase where you do not expect frequent updates. The package is mature and does one thing well, but its abandonment since 2017 means you should verify compatibility with your current matplotlib and Python versions before adopting it in new projects.
Install
descartes on PyPI
pip
pip install descartesuv
uv add descartespoetry
poetry add descartesInstalling descartes
Before you install
Low install friction with pure Python wheels available. However, the package is abandoned—last release was in 2017, over 3496 days ago. No recent maintenance or updates; use only if existing functionality meets your needs.
License in practice
BSD license (permissive) places no significant restrictions on use, modification, or distribution in most contexts.
Quickstart
pip install descartes matplotlib
from matplotlib import pyplot
from descartes import PolygonPatch
patch = PolygonPatch({'type': 'Polygon', 'coordinates': [[(0, 0), (1, 0), (1, 1), (0, 1), (0, 0)]]}, fc='blue', alpha=0.5)
ax = pyplot.gca()
ax.add_patch(patch)
pyplot.show()
Requires matplotlib; numpy is an implicit dependency. Shapely 1.2+ is optional but typically used for geometric operations.
Verify before relying
- Whether the package works reliably with current versions of matplotlib and numpy given its 2017 release date.
- Compatibility with modern Python versions beyond what classifiers declare.
- Whether active alternatives exist for this use case in the current ecosystem.
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — matplotlib |
| Maintenance | abandoned — 3,496 days since the last release |
| First released | |
| Downloads | 676,373/month — #5,383 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: descartes-1.1.0-py2-none-any.whl; descartes-1.1.0-py3-none-any.whl
Keywords: matplotlib, gis, geojson, geometry
Tags
More GIS packages
Shapely provides Python tools for creating,…
permissive · top 1,000 on PyPI
pyprojpyproj provides a Python interface to PROJ,…
permissive · top 1,000 on PyPI
geopandasGeoPandas extends pandas DataFrames to handle…
permissive · top 1,000 on PyPI
geopygeopy is a Python client for geocoding and…
permissive · top 5,000 on PyPI
pyogrioPyogrio provides fast, bulk-oriented read and…
permissive · top 5,000 on PyPI
h3h3 provides Python bindings to Uber's H3…
permissive · top 5,000 on PyPI
matplotlib-vennPlots area-weighted two- and three-circle Venn…
permissive · top 15,000 on PyPI
CartopyCartopy makes it easy to draw maps for data…
permissive · top 5,000 on PyPI
antimeridianFixes Shapely geometries and GeoJSON features…
permissive · top 15,000 on PyPI
shapely-polyskelComputes the straight skeleton of a polygon, a…
copyleft · top 15,000 on PyPI
osm2geojsonConverts OpenStreetMap and Overpass API data…
permissive · top 15,000 on PyPI
pygeoifPyGeoIf provides lightweight, pure-Python…
copyleft · top 15,000 on PyPI
geometConverts between GeoJSON, WKT/WKB, Extended…
permissive · top 5,000 on PyPI
highcharts-mapsHighcharts Maps for Python wraps the Highcharts…
unclear · top 15,000 on PyPI
pygeosPyGEOS wraps GEOS geometry operations in NumPy…
permissive · top 15,000 on PyPI