Country borders out of scope for polar projections w/ `axes=False`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 21
- Forks
- 11
- Avg merge
- 7h 11m
- Merged PRs (30d)
- 1
Description
When doing (at least) contour plotting with the projection set with mapset to either of the polar stereographic cases, "npstere" or "spstere", and axes=False set to turn off x and y axes plotting, the country borders go out-of-scope of the circular plotting area for the data appearing to be square with the same height/width as the circle diameter (see example images below), so ultimately they are unaligned with the data. Note this issue does not affect other projections (as tested), only these polar ones.
May be related to #55, which also concerns incorrect plot output with the polar stereographic projections, but doesn't look immediately similar in terms of user-facing/plot outcome issue.
MRE with environment
import cfplot as cfp
import cf
cf.environment()
f = cf.read(f"{PATH}/ggap.nc")[0]
cfp.gopen(file="mre-1.png")
cfp.mapset(proj="npstere") # or set with "spstere" instead
cfp.con(
f.subspace(pressure=850),
axes=False,
)
cfp.gclose()
Outputs from MRE
With the axes=False line in, the issue occurs:
npstere
spstere
Working cases, for comparison
Whereas without axes=False, everything is OK:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided minimal reproduction with cfp.mapset(proj="npstere" or "spstere") and cfp.con(..., axes=False), then compare it with axes enabled. Trace the polar projection setup and country-border rendering to identify why the borders use bounds outside the circular plotting area. Done means both polar cases align borders with the data circle while other projections remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100