-
Notifications
You must be signed in to change notification settings - Fork 369
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
Incorrect tick labels #204
Comments
There was a pull request merged 2 days ago which adds proper support for tick (in some very limited projections). The ticks you're seeing here are simple matplotlib ticks which have no knowledge of cartopy - hence they are plotting in the "native" coordinate system. Would you be willing to give the functionality added by @pp-mo in #200 a shot? |
OK you mean using the
which produces: which is obviously not quite right! I guess I have misunderstood. I thought because |
Agreed! 😄
We've not yet done anything to the
In truth, we've not focused on this so much. Your original approach might actually be easier in the short term - I'd think about defining a Formatter which takes the native coordinates and transforms them into the coordinate system you wanted. As for the Cheers, |
OK well I combined this with |
The mouse-over positions are also reported incorrectly with |
@bblay - I can't reproduce this. Are you doing something like:
|
Yep, I cut and paste that into python and when I hover the mouse near the left edge it says -178. I just noticed it also has the correct coords, with units, in brackets afterwards |
There are still issues with tick marks/gridlines that need to be addressed, but perhaps this particular issue can be closed now and replaced with more specific issues/feature requests? |
Those coordinates are the coordinates of the projection you are plotting (which in your case are shifted by 180 degrees. The coordinates in brackets are the coordinates in "lons and lats" which are probably what you're expecting. Thanks for following this through @bblay.
I don't want to loose any bug report. I'm pretty certain the repeated 180/-180 exists in the tick marks, is there anything else that I'm missing? I agree we can go ahead and open a specific issue for this (would you mind doing this?). When you're happy that all the issues are covered by folllow-up issues, please go ahead and close this one. |
As this is an old but still existent problem in cartopy, I found a workaround that works at least for the PlateCarree() projection. In mpl/gridliner.py [cartopy v0.11.0] I inserted the following code at line 239:
Maybe this is an approach for a patch, but it doesn't solve the problem of incorrect doubled labeling at 180°E/180°W, if |
There is now a formatter object provided with cartopy that attempts to resolve this, albeit in a bit of a work-around fashion. See this example for details: http://scitools.org.uk/cartopy/docs/latest/examples/tick_labels.html (although the image was cropped when the documentation is created, if you run the example yourself you should see the correct labels). |
Apologies, I didn't read that correctly. This issue refers specifically to tick marks, so I assumed this was your issue. Feel free to open a new issue for this problem, it probably won't get much attention here. |
When putting tick labels on a
cartopy.crs.PlateCarree
projection the longitude labels are incorrect if a central longitude of 180 is used. To reproduce:(I also just realised 90S and 90N are missing on the latitude axis too!)
If I use 0 as the central longitude then the longitude labels are correct.
Perhaps I'm just doing this wrong?
The text was updated successfully, but these errors were encountered: