The making of Maps with Python
A world from a function.
A few lines of Python turn longitude and latitude into a different view of Earth. You can read them, change them, and run them right here.
Python does the mathematics.
NumPy handles the arrays of coordinates. Pyodide brings Python to your browser in a worker, so a calculation can run without taking over scrolling. React builds the interface; Three.js draws and animates the maps. The drawing engine uses the coordinates returned by your Python.
The opening maps are precomputed from the same Python shown in the lessons. That makes exploring them fast, including on phones. Opening the editor loads Python on demand; pressing Run computes your edited function. Your code runs in your browser, with no server executing it. Drafts stay in this browser.
Take the experiment with you.
Each notebook includes real Natural Earth geography and uses GeoPandas, NumPy, and Matplotlib. Open it in nteract or Jupyter, then run the cells in order.
- Mercator notebook ↓
- Gall–Peters notebook ↓
- Equal Earth notebook ↓
- AuthaGraph notebook ↓
- Mollweide exercise ↓
- Mollweide worked solution ↓
Anaconda provides tools for managing Python environments and experimenting with data. The repository includes an environment file for these notebooks. With conda installed:
conda env create -f environment.yml
conda activate maps-with-python
jupyter labThe source code is available under the BSD 3-Clause license. Run npm ci and npm run dev to work on the site; the README documents map generation and validation.
Use AI as a thinking partner.
This site was developed with AI assistance. Python’s readable functions make it useful for asking an AI to explain an equation, propose an experiment, or help debug an error. Ask it to state assumptions and test them against known coordinates.
“Explain this projection one line at a time. Help me predict what changing one coefficient will do. Suggest tests at the equator and poles before showing me an implementation.”
A convincing explanation is not enough: compare the geometry, check numerical results, and consult the original mathematics. The challenge’s sample checks help, but do not prove a projection correct everywhere.
Credits and sources.
Maps with Python is presented by Anaconda Incubation. The mapmakers’ ideas are the foundation of every lesson.
- Mercator — Gerardus Mercator published his navigation-focused world map in 1569. Its useful rectangular grid later became familiar far beyond navigation.
- Gall–Peters — James Gall described this projection in 1855. Arno Peters popularized it in 1973, emphasizing the importance of representing countries in their correct relative sizes. The same cylindrical equal-area family offers many standard-parallel choices.
- Equal Earth — Bojan Šavrič, Tom Patterson, and Bernhard Jenny introduced Equal Earth in 2018. They combined the useful area property with a familiar-looking world-map shape and published the formulas for others to implement. This is one of the equal-area projections the UN General Assembly recommended on September 4, 2026, for maps where relative size matters. Read the UN recommendation ↗
- AuthaGraph — Hajime Narukawa developed AuthaGraph through a geometric construction. His 2022 paper gives a mathematical formulation using cones and a tetrahedron. That is the formulation here, with a public rectangle arrangement, rather than the original hand-built commercial artwork.
- Mollweide — Karl Brandan Mollweide, 1805. The exercise uses the spherical equations; PROJ supplies an independent reference for validation.
Geography: Natural Earth (public domain). Globe imagery: NASA Blue Marble. Rendering and interface: Three.js, React, CodeMirror, and KaTeX. Type: Source Serif 4, Inter, and JetBrains Mono.
Third-party code, data, fonts, and Anaconda branding retain their own licenses and rights; see the repository’s notices. Sources & notes in the page menu provides additional references and our geographical naming policy.
