Editing legends with ggplot – General

Hi,
Is it possible to edit more than one legend in ggplot? I’m using ggplot to map a raster and a shape file with coordinates. I would like to place the legend of the raster at the bottom and place the legend of the coordinates at the right side of the map.

This is the code I’m using:

S_EFT_df %>%
select(x, y, 2001) %>%
ggplot()+
geom_raster(aes(x = x, y = y, fill = 2001))+
scale_fill_viridis_c(name= “EFT”) +
ggtitle(“”)+
guides(legend.position = “bottom”, plot.title = element_text(size=20, face=”bold”, hjust=0.5)) +
theme_void() +
coord_equal()+ #minimize distortion
geom_sf(data = Guade, aes(color = Species), col=”red”)+
guides(legend.position=”right”, col = guide_legend(“Species”,nrow = 9, byrow = TRUE,override.aes = list(size = 1.5)))

Thank you.

Read more here: Source link