-
Notifications
You must be signed in to change notification settings - Fork 371
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
Feature request: generalized meridian/parallel labelling, like in Basemap #881
Comments
I agree, I see that this issue has come up a number of times in past discussions (for at least ~3-4 years now?), but I don't see any other open related feature requests, so I think this needs highlighting again. I want to use cartopy, but for any professional publications this is sort of a deal breaker for me too. I think even implementing an API that (initially) requires the user to specify which ticks to draw and which axis to draw them on (for some projections) would be acceptable. I don't think that would interfere with the longer term development/stability of the API, as that customizability would still be useful even after cartopy can come up with a good guess by itself. Has there been any discussion of what such an API should/could look like to fit in cartopy's style? I get that this is hard, and for some projections very hard, but it seems pretty important for a mapping library. |
I'm a big 👍 on this. Questions for the Cartopy developers:
|
In my opinion doing this completely generically would be very difficult (although probably achievable). However, I think implementing something that is not completely generic but suits 90% of use cases could be done. It would be useful to know what the typical requirements are so an API can be designed. Some years ago I produced an example of how to label a plot using a Lambert Conformal projection: https://gist.github.com/ajdawson/dd536f786741e987ae4e. I hope that this can help demonstrate both the possibilities of what could be achieved, but also highlight why this is difficult (i.e. how to pick locations depends on the shape and orientation of the map, which depends on the subdomain within the projection being plotted, and on user tastes as to what they'd like to see labelled). |
Landing here to add a big thumb up to this issue.... doesn't seem to be any pull request open on this, so I was wondering if there is a plan to work it into next versions. I want to move from basemap to cartopy, given the imminent EOL of basemap, but, as for many other folks, the lack of labeling makes it problematic. |
Similar to basemap. Andy Heaps's |
I'd like to ping this again - this is a killer for switching for me. If it can be done without too much trouble for the majority of use-cases, I think that would be worth it rather than waiting for something completely generalized. I actually just tested the gist that @ajdawson posted using all of Cartopy's supported projections with no other modifications other than changing the projection (the functions in the gist are labeled "lambert_ticks" but I don't think there's anything in there that is specific to that projection alone) and it actually worked just fine for most. Here's what happened: The tick labelling on all projections worked perfectly except:
|
Seems like there is clear need for this feature but maybe not enough time available to dedicate to the issue? Working in Alaska, we rarely use Plate Caree or Mercator, though I appreciate that they're very common. |
A temporary hacky method if anyone's interested.
|
Just wanted to capture that this matplotlib example may point to some code in matplotlib that may help implementation. |
Any progress here? I have just triggered the following error when trying to use
I have also found the 2 following examples (that don't seem to be mentioned above) for labelling and projections on the matplotlib web site. One even mentions cartopy |
I think this was merged in #1117 which will be in the next release. |
Sorry should have closed this a while ago. Cartopy's current meridian/parallel labeling features are really awesome :) |
The
basemap
package frommpl_toolkits
allows labelling parallels/meridians wherever they cross any of four edges of the projected region, "left/right/top/bottom".For example, from the examples gallery
labels wherever parallels intersect the right/top of the plotting area, and wherever meridians intersect the left/bottom of the plot (this is specified by the labels kwarg). See this link.
I think I understand one of the issues with this: for situations like the north polar azimuthal equidistant projection, we have a circle and there is no "left/right/top/bottom".
basemap
solves this by just making these projections into squares (kind of a workaround); forcartopy
this would need careful considerations. But the pseudocylindrical projections (like Robinson) and other square/rectangle-shaped projections could usebasemaps
's implementation pretty much as-is.I find labelling the parallels/meridians absolutely necessary for professionally visualizing geophysical data (and I think others in my field would agree); for the time being this has been a dealbreaker, even though
basemap
is clearly outdated and I suspectcartopy
is the future.The text was updated successfully, but these errors were encountered: