basemap
Plot data on map projections with matplotlib
What it is and what it does
Basemap is a matplotlib toolkit for plotting data on map projections. It wraps geographic functionality—coastlines, political boundaries, coordinate transformations—around matplotlib's plotting engine, letting you render scientific and geographic data directly onto maps with support for various projections. The package depends on numpy, matplotlib, pyproj for coordinate system handling, and pyshp for shapefile support, plus basemap-data for essential map assets.
It's used when you need to visualize spatial data on actual geographic coordinates rather than abstract Cartesian grids. The library handles projection mathematics and provides ready-made geographic features so you can focus on your data layer. Installation is straightforward via pip with precompiled wheels available for current Python versions.
Use it for:
- Plot weather or climate data on geographic maps with proper projections
- Visualize seismic events or geological survey data on regional or global maps
- Create publication-quality maps for scientific papers with coastlines and borders
- Display GPS trajectories or ship routes on map projections
- Generate maps showing regional statistics by country or state
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Basemap renders geographic data on matplotlib figures using map projections, with built-in coastlines and political boundaries.
Yes, if you need to plot scientific or geographic data on real map projections with matplotlib. The package is actively maintained, has no known vulnerabilities, and offers straightforward installation via precompiled wheels. Medium install friction is acceptable for the functionality gained. Not necessary if you only need simple lat/lon scatter plots.
Install
basemap on PyPI
pip
pip install basemapuv
uv add basemappoetry
poetry add basemapInstalling basemap
Before you install
Medium install friction due to compiled dependencies. Precompiled wheels available for Windows, macOS (Intel and ARM), and Linux across Python 3.9 through 3.13. Actively maintained with last commit 2026-05-04.
License in practice
MIT license for the library; GEOS dynamic library bundled with wheels is LGPL-2.1-only. Permissive licensing allows commercial and private use with attribution.
Quickstart
import basemap
import matplotlib.pyplot as plt
import numpy
# Create a Basemap instance with desired projection
# Add geographic features and plot data
plt.show()
Requires basemap-data package for basic map assets; optional basemap-data-hires for high-resolution data.
Verify before relying
- Specific syntax and parameters for common projection types and coordinate transformations
- Performance characteristics with large datasets or high-resolution projections
- Current status and usage of optional OWSLib integration for wmsimage method
- Details on fillcontinents workaround using drawlsmask method
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<3.14,>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 6 — basemap_data, packaging, numpy, matplotlib, pyproj, pyshp |
| Maintenance | actively maintained — 427 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 105,043/month — #12,725 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: basemap-2.0.0-cp310-cp310-macosx_10_9_x86_64.whl; basemap-2.0.0-cp310-cp310-macosx_11_0_arm64.whl; basemap-2.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; basemap-2.0.0-cp310-cp310-win_amd64.whl; basemap-2.0.0-cp311-cp311-macosx_10_9_x86_64.whl; basemap-2.0.0-cp311-cp311-macosx_11_0_arm64.whl; basemap-2.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; basemap-2.0.0-cp311-cp311-win_amd64.whl; basemap-2.0.0-cp312-cp312-macosx_10_13_x86_64.whl; basemap-2.0.0-cp312-cp312-macosx_11_0_arm64.whl; basemap-2.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; basemap-2.0.0-cp312-cp312-win_amd64.whl; basemap-2.0.0-cp313-cp313-macosx_10_13_x86_64.whl; basemap-2.0.0-cp313-cp313-macosx_11_0_arm64.whl; basemap-2.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; basemap-2.0.0-cp313-cp313-win_amd64.whl; basemap-2.0.0-cp39-cp39-macosx_10_9_x86_64.whl; basemap-2.0.0-cp39-cp39-macosx_11_0_arm64.whl; basemap-2.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; basemap-2.0.0-cp39-cp39-win_amd64.whl
Keywords: GIS, maps, plots
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
basemap-dataProvides geographic data assets (coastlines,…
copyleft · top 15,000 on PyPI
CartopyCartopy makes it easy to draw maps for data…
permissive · top 5,000 on PyPI
contextilyContextily retrieves tile-based map imagery…
permissive · top 15,000 on PyPI
pyprojpyproj provides a Python interface to PROJ,…
permissive · top 1,000 on PyPI
matplotlibmatplotlib creates static, animated, and…
permissive · top 1,000 on PyPI
plotbinPlotBin provides utilities to create and…
unclear · top 15,000 on PyPI
cmapcmap provides a collection of scientific…
permissive · top 15,000 on PyPI
splotsplot creates static and interactive…
permissive · top 15,000 on PyPI
foliumfolium builds interactive web maps by combining…
permissive · top 5,000 on PyPI
cmoceanProvides perceptually uniform colormaps…
unclear · top 15,000 on PyPI