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

missing gridlines: InterruptedGoodeHomolosine #1015

Closed
mathause opened this issue Jan 30, 2018 · 5 comments · Fixed by #1146
Closed

missing gridlines: InterruptedGoodeHomolosine #1015

mathause opened this issue Jan 30, 2018 · 5 comments · Fixed by #1146

Comments

@mathause
Copy link
Contributor

mathause commented Jan 30, 2018

I just noticed that the only one x-gridline gets drawn with InterruptedGoodeHomolosine. This is is in contrast to the Example. So maybe it's a matplotlib issue?

import cartopy
import matplotlib
print(cartopy.__version__)
print(matplotlib.__version__)

0.15.1
2.1.1

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

ax = plt.axes(projection=ccrs.InterruptedGoodeHomolosine())
ax.coastlines(resolution='110m')
ax.gridlines()

interruptedgoodehomolosine_gridlines

Expected outcome

@pelson
Copy link
Member

pelson commented Feb 14, 2018

Yes, it looks likely that this is a matplotlib version issue. @QuLogic - did you see anything like this on your mpl 2 travels?

@QuLogic
Copy link
Member

QuLogic commented Feb 15, 2018

It seems to come from matplotlib/matplotlib@9982e40, but I'm not entirely sure why.

@QuLogic
Copy link
Member

QuLogic commented Feb 15, 2018

Though 6061b2c should have been a related fix; not sure why it didn't help.

@QuLogic
Copy link
Member

QuLogic commented Sep 27, 2018

Well, this was a confusing one. It turns out that the locations of the meridians are fine, but what changed were the parallels. The meridians are drawn from the minimum parallel to the maximum parallel. In Matplotlib 1.5.3, the parallels were range(-80, 81, 20), but with 2.0.0, the parallels are range(-90, 91, 18). Technically, this was always sort of a bug in Matplotlib locators, since the limits are actually [-78.4, 78.4] and the outer values should not be drawn.

Apparently, for IGH, if you draw the meridians from -90 to 90 latitude, they don't transform right. If I patch it to start at -89, then all the gridlines show up again.

So there are two bugs:

  1. We need to clip gridlines to the actual view limits; this is something Matplotlib does even though locators output values outside the specified limits.
  2. Something may or may not be weird with IGH at -90

@QuLogic
Copy link
Member

QuLogic commented Sep 27, 2018

Of course, the former is easier said than done, since sometimes you want the gridline to end at the last of the other direction, and sometimes you don't, depending on the projection. This might need some kind of option to get right.

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.

3 participants