Skip to content

Figure.choropleth: Refactor using low-level sessions and virtualfiles#4700

Open
seisman wants to merge 2 commits into
mainfrom
choropleth/refactor
Open

Figure.choropleth: Refactor using low-level sessions and virtualfiles#4700
seisman wants to merge 2 commits into
mainfrom
choropleth/refactor

Conversation

@seisman

@seisman seisman commented Jun 25, 2026

Copy link
Copy Markdown
Member

Previously, the Figure.choropleth method was implemented by wrapping the Figure.plot method. It's simple, but has the following downsides:

  1. The Figure.plot method has complicated codes for dealing with diverse input format, which is necessary for Figure.choropleth
  2. Extra parameters are passed to Figure.plot via **kwargs, but many parameters, such as symbol/straight_line/errorbar don't make sense in Figure.choropleth.

This PR reimplements Figure.choropleth using the lower-level plot module call instead of wrapping Figure.plot. Also updates the docstring to describe the method directly instead of as a thin wrapper around Figure.plot.

Strictly speaking, this is a breaking change, as kwargs is removed. Since this method was added after v0.18.0, it's not public yet. So the breaking change should have no effect on existing scripts.

Preview: https://pygmt-dev--4700.org.readthedocs.build/en/4700/api/generated/pygmt.Figure.choropleth.html#pygmt.Figure.choropleth

Address #4414. Supersedes #2798.

@seisman seisman added maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog needs review This PR has higher priority and needs review. labels Jun 25, 2026
@seisman seisman added this to the 0.19.0 milestone Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Boring but important stuff for the core devs needs review This PR has higher priority and needs review. skip-changelog Skip adding Pull Request to changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant