It's my first time making graphs with geom_sf (and ggplot2), so I'm facing some difficulties.
I'm working with two datasets and I can't figurw out how to change the legend.
I'm using ggmap and omsdata for the baseline.
`bl_basemap <- get_map(location = getbb("belluno"), zoom = 9, maptype = 'toner-hybrid', source = 'stamen')
ggmap(bl_basemap) +
geom_sf(data = geobelluno2cdp, aes(colour = f, size=f), inherit.aes = FALSE) +
geom_sf(data = geopnasc, fill = "red", color = "red", inherit.aes = FALSE) +
guides(color = guide_legend(override.aes = list(fill = "red")))+
coord_sf(crs = st_crs(4326)) +
xlab("LONGITUDINE") +
ylab("LATITUDINE") +
ggtitle("Belluno (2022)") +
theme(plot.title = element_text(hjust = 0.5))`
This code prodices the following plot
I'm trying to add the red points to the label under the one already present.
I tried adding show.legend = "point", but the red points show inside the blue points.
`ggmap(bl_basemap) +
geom_sf(data = geobelluno2cdp, aes(colour = f, size=f), inherit.aes = FALSE) +
geom_sf(data = geopnasc, fill = "red", color = "red", inherit.aes = FALSE, show.legend = "point") +
guides(color = guide_legend(override.aes = list(fill = "red")))+
coord_sf(crs = st_crs(4326)) +
xlab("LONGITUDINE") +
ylab("LATITUDINE") +
ggtitle("Belluno (2022)") +
theme(plot.title = element_text(hjust = 0.5))`
How can I solve this problem?