I'm drawing a geographical map of my country using ggplot2. Actually, I've got what I was looking for, but I want something more in the legend. I have a dataset like this:
City Name Nominal Wage Real Wage
Rome 1200 15
Milan 1500 16
Naples 700 12
.... .... ...
I want to draw the map of my country and fill the regions around some cities according with specific values for Real Wage
that I set.
The script that I'm using is this ( "prov2022" is a shapefile for the geographic map)
right_join(prov2022, dataset, by = "COD_PROV") %>%
ggplot(aes(fill = `Real Wage`))+
geom_sf(data = ~ dplyr::mutate(., `Real Wage` = ifelse(`Real Wage` >= 15 & `Real Wage` <= 16, `Real Wage`, `Real Wage`[NA]))) +
theme_void() +
scale_fill_gradientn(colors = 'blue', na.value = "#00000000")
It works perfectly, but the legend that I get contains as title the name of the variable Real Wage
and the scale of colors used to fill the areas. Here the screenshot
Is there a way to remove that useless scale of colors ( because i'm using just one to fill) and create a legend instead that contains the City Name
and the values of the variable Nominal Wage
next to the specific values of Real Wage
of the areas filled???