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

Inaccurate distinction between ocean and land when plotting the Arctic #1674

Closed
xiuyongwu opened this issue Oct 31, 2020 · 1 comment · Fixed by #2470
Closed

Inaccurate distinction between ocean and land when plotting the Arctic #1674

xiuyongwu opened this issue Oct 31, 2020 · 1 comment · Fixed by #2470

Comments

@xiuyongwu
Copy link

xiuyongwu commented Oct 31, 2020

Now, I'm ready to plot the map for the Arctic, with land and ocean in different colors.
However, when I add_feature to the land and ocean, the color of ocean will overlap the land (or the continents near the Arctic). That is, the cartopy may be treat the ocean inaccurately in the Arctic.

The code for this map is shown as follows:

import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import cartopy.feature as cfeature
fig = plt.figure(figsize=[5,5])
ax1 = fig.add_subplot(1, 1, 1, projection=ccrs.NorthPolarStereo(central_longitude=0))
ax1.set_extent([-180, 180,60, 90], ccrs.PlateCarree())
ax1.gridlines()
ax1.add_feature(cfeature.LAND)
ax1.add_feature(cfeature.OCEAN)
plt.show()

However, if I exchange the order for the two sentences, write the "ax1.add_feature(cfeature.OCEAN)" first and then write "ax1.add_feature(cfeature.LAND)", it seems works.

Code to reproduce


Traceback


Full environment definition

Operating system

Cartopy version

conda list

pip list

@greglucas
Copy link
Contributor

There is an interpolation that takes place when adding those features to a different projection than the one they are defined in. Some other options:

  • Set the axes background color to the ocean color and overplot the land to make sure there are no gaps at all.
  • The default OCEAN and LAND features are also very coarse resolution (110m), so you can try to use cfeature.LAND.with_scale('10m') to get higher resolution data to plot and look nicer too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants