-
Notifications
You must be signed in to change notification settings - Fork 25
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
geom_labelsf() not recognizing aesthetics #74
Comments
Hi there, Thanks for reporting the issue, I can confirm that this isn't currently handled as you'd expect. I'd know how to activate the text parameters, but I'm not sure how I'd go about the |
The aesthetics work a bit differently within the sf geoms, and as Teun says, the However, it is possible to achieve what you want using the current version without much trouble: library(tidyverse)
library(sf)
#> Linking to GEOS 3.9.1, GDAL 3.2.1, PROJ 7.2.1; sf_use_s2() is TRUE
library(geomtextpath)
sample_coords <- tibble(
x = c(43.00778, 42.99675),
y = c(-87.94263, -87.90710)
) %>%
st_as_sf(coords = c("y", "x"), crs = 4326) %>%
summarise() %>%
st_cast(., "LINESTRING")
sample_coords %>%
ggplot() +
geom_labelsf(label = "Label", boxfill = "red",
linewidth = 0) Created on 2022-03-02 by the reprex package (v2.0.1) |
Ah, got it. I only included the |
I'll leave this open until I get round to improving the docs for this feature. Thanks for raising it @Pecners |
Excellent foresight, Allan! |
First of all, thank you for this fantastic package! The issue I'm having is that
geom_labelsf()
doesn't seem to be passing on aesthetic arguments on togeom_labelpath()
as the documentation indicates.For instance, here's an example of
geom_labelsf()
not recognizing thefill
ortext_only
arguments.Using the non-spatial
geom_labelpath()
with the same arguments, however, works as expected.I appreciate any guidance you can provide. Thanks again!
Created on 2022-03-02 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: