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

xtick labels not respecting central_longitude for PlateCarree() #1106

Closed
erikvansebille opened this issue Aug 10, 2018 · 1 comment
Closed

Comments

@erikvansebille
Copy link

Description

The xlabels in the PlateCarree (and potentially other projections) don't respect the central_longitude. In the example code below, the central longitude is correctly set to 160E. The xlabel at that longitude, however, is 0.

cartopy_bug

I've seen the same issue in #204, but there is was first reported fixed and then a patch was proposed. That does not seem to be included in version 0.16.0?

Code to reproduce

import matplotlib.pyplot as plt
import cartopy.crs as ccrs

proj = ccrs.PlateCarree(central_longitude=160)
ax = plt.subplot(111, projection=proj)
gl = ax.gridlines(crs=proj)
gl.xlabels_bottom, gl.ylabels_left = (True, True)
ax.coastlines()
plt.show()
Full environment definition

Operating system

macOS with Python 2.7.15

Cartopy version

0.16.0

conda list

pip list

@QuLogic
Copy link
Member

QuLogic commented Nov 24, 2018

You should not pass crs=proj when calling ax.gridlines, because in that projection, 0 is at 160E. So in fact, it is respecting the central longitude and placing 0 where you tell it to place it. If you pass nothing, you get a 0 tick in the expected location.

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

2 participants