I'm working on plotting sf objects in ggplot2. I have a set of polygons buffered
that have a density value for each polygon density
. I want to plot this along with a single sf point GPS_point
as a reference point. The problem I am running into is that I cannot set the fill
color separately for each object.
ggplot() +
geom_sf(data = buffered, aes(fill = density),lwd = 0) + #polygons filled based on the density value
geom_sf(data = GPS_point, aes(fill = "red"), size = 5) + #reference point that I want to make red
scale_fill_viridis_c(option = "magma",begin = 0.1)
I am trying to set the reference point fill color to red. The current code sets the fill for both objects as magma
. The problem is that this makes the reference point indistinguishable from the background because they end up as the same color. Is there any way to manipulate the fill color separately for these two geom_sf
calls?