-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Stat for ploting sf data as label and text #2742
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
Comments
I’ve been thinking about this as well, and can’t see how much of extra complexity it would add. If it’s decided not to be put in ggplot2 I would welcome it in ggforce |
If you think you can implement it without adding a bunch of extra options (and default aesthetics) to |
Thanks! Actually, c.f. https://yutannihilation.github.io/ggsflabel/reference/geom_sf_label.html I expect implementing them doesn't affect |
Yeah that sounds good and I’d be happy to review a PR. I’d probably suggest documenting with geom_sf |
Sure! @thomasp85 |
Yes |
@yutannihilation Maybe you can talk to the maintainer of ggrepel whether they can be added there directly? Seems like the more logical place. |
@clauswilke Agreed, thanks! |
This is also a feature I use from time to time (doing things manually, with |
Closes #2742 * Add geom_sf_label() and geom_sf_text() * Add a missing parenthesis * Add tests for stat_sf_coordinates() * Fix a typo * Fix a typo in examples * Add visual tests for geom_sf_label() and geom_sf_text() * Match args for stat_sf_coordinates() and StatSfCoordinates$compute_group() * Document stat_sf_coordinates()'s na.rm * Add documents about stat_sf_coordinats() * Set the default of fun.geometry to NULL When sf package is not installed, test-function-args fails. * Set more fun.geometry to NULL * Fix mistakenly passed sf::point_on_surface * Stop cross-referencing sf functions * Ignore Z and M dimension * Fix the example of stat_sf_coordinates() * Remove Rplot001.png * Fix doc of stat_sf_coordinates() * Fix an example of stat_sf_coordinates() * Fix default fun.geometry and tests * Fix a typo in doc * Add reference images for vdiffr tests * Disable stat-sf-coordinates test * Fix "texts" to "text", and move seealso * Add () to functions in ggsf.Rd for consitency * Add a news bullet
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
According to #2111, ggplot2 decided not to implement
stat_sf(geom = "text")
to avoid complexity.But, I face the necessity to plot labels and texts on sf maps so often that I'm urged to make a package...
IIUC, it's not so complicated to implement a stat that retrieves the coordinates from a sf object and map the computed variables
X
andY
. Do you feel it's ok for this to live in ggplot2? If yes, I'm happy to make a PR. (If no, I will develop my package and submit it to CRAN.)Here's an example implementation:
Created on 2018-07-08 by the reprex package (v0.2.0).
The text was updated successfully, but these errors were encountered: