Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Country borders out of scope for polar projections w/ axes=False #77

Open
sadielbartholomew opened this issue Oct 3, 2024 · 0 comments

Comments

@sadielbartholomew
Copy link
Member

sadielbartholomew commented Oct 3, 2024

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

mre-1

spstere

mre-2

Working cases, for comparison

Whereas without axes=False, everything is OK:

mre-1works
mre-2works

@sadielbartholomew sadielbartholomew changed the title Setting axes=False causes b Country borders out of scope when axes=False set with polar projections Oct 3, 2024
@sadielbartholomew sadielbartholomew changed the title Country borders out of scope when axes=False set with polar projections Country borders out of scope when axes=False set w/ polar projections Oct 3, 2024
@sadielbartholomew sadielbartholomew changed the title Country borders out of scope when axes=False set w/ polar projections Country borders out of scope for polar projections w/ axes=False Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant