Uh oh!
There was an error while loading. Please reload this page.
Add choropleth support to GeoAxes - #623
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a first-class GeoAxes.choropleth API for coloring polygon geometries (including country-keyed inputs) and integrates it with UltraPlot’s colormap/colorbar pipeline, along with docs examples and geographic tests (closes #622).
Changes:
- Implement
GeoAxes.choropleth()plus supporting geometry projection/path helpers inultraplot/axes/geo.py. - Add targeted choropleth tests for collections, missing-value styling, country resolution, zorder, and validation errors.
- Add documentation examples demonstrating polygon- and country-based choropleths.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
ultraplot/axes/geo.py | Introduces GeoAxes.choropleth() and helper utilities for projecting shapely polygon rings into backend coordinates and producing PatchCollections. |
ultraplot/tests/test_geographic.py | Adds unit tests covering choropleth rendering behavior, country-identifier resolution, zorder defaults, and input validation. |
docs/projections.py | Adds a new projections guide snippet demonstrating polygon choropleth usage with colorbar formatting. |
docs/examples/geo/04_choropleth.py | Adds a standalone documentation example for country-keyed choropleths with missing-value styling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
From the example, the |
That is a z-order issue let me fix that. The choropleth shapes are drawn on top of the existing geometries. |
Uh oh!
There was an error while loading. Please reload this page.
* Add choropleth support to GeoAxes * Use rc defaults for choropleth * Move to docstring snippet manager * Spelling error * Overlay choropleth edges above borders

Add a first-class GeoAxes.choropleth API for polygon geometries and country-keyed values, including colorbar integration, missing-value styling, documentation examples, and targeted geographic tests. Closes#622.