-
Notifications
You must be signed in to change notification settings - Fork 299
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
Make label formatting in st_graticule() configurable? #829
Comments
For the example above, at latitude 36.5 which label would you have preferred over the current 36.5? |
Yes, the placement can be configured, but the formatting can't. In the above example, I might want to have 36.0 instead of 36 so it aligns with 36.5. I might also want to be able to create labels that say -84E instead of 84W, or lowercase "w" instead of "W", or whatever else somebody might come up with. Currently you use the internal functions |
Also, when looking at this code: Lines 154 to 157 in d2634d1
I'm wondering whether it would make sense to encapsulate this entire unit into a function that takes as arguments lon , lat , crs , and datum , and users could then supply an alternative to that function.
|
This gets you the 36.0 by default, which is indeed better. About exposing a |
Ah, I now see option 3: is this needed to get |
Thanks! It's mostly option 3: Tick labels are configurable all over ggplot2 except for |
It would be nice if the
degree_label()
thatst_graticule()
generates could be configured in some way. In ggplot2, this problem is usually solved via formatting functions. Would it be possible to add arguments for longitude and latitude label formatting functions tost_graticule()
, so that users can provide their own that may behave somewhat differently from the default?For a very simple use case, consider the following example, where some labels are presented as integer values and others as fractions. I don't think there is currently a way to prevent this.
Created on 2018-08-23 by the reprex package (v0.2.0).
The text was updated successfully, but these errors were encountered: