I have a shapefile, my_sf
. If I write:
ggplot() +
geom_sf(
data = my_sf,
size = 0.5 # this is the default value actually
)
then it works just fine. However, if I add a my_line_width
attribute to my_sf
, and set each value in that column to 0.5, and then write:
ggplot() +
geom_sf(
data = my_sf,
aes(size = my_line_width)
)
then I get a bunch of massive lines that overlap hideously. If the normal lines are width 0.5, then these are perhaps width 4. I don't understand why those don't produce the same result (aside from the legend, which I know only pops up if you use an aesthetic). Does anyone know what's going on?
I have also tried using lwd
instead of size
. Exactly the same thing happens: it's fine when I just set a static value, but when I try to provide values through an aesthetic, it goes wrong.