i just need a minor tweak. I am drawing a choropleth with ggplot
. Everything works fine, except one ecstatically misleading aspect: as you can see in the figure here
ggplot picks 0
as a starting value for the shading of the provinces, while the vector of values lies between 0.331
and 0.591
. I believe a starting value of, say, 300
, would enhance the differences between the different provinces.
This is my code:
ggplot(final.plot.orph, aes(x = long, y = lat, group = id, fill = CMPI)) +
geom_polygon() +
coord_equal() +
scale_fill_distiller(palette = "Blues", direction = 1) +
theme_void() +
theme(legend.position = "bottom",
panel.background = element_rect(fill = NA, colour = "#cccccc")) +
with(province_orph, annotate(geom = "text", x = lab_long, y = lab_lat, label = label, size = 2.5))
I guess it has something to do with the scale_fill_distiller
. After looking at the documentation, I tried to include
rescale(to = c(0.300, 0.600), from = c(0, 1))
as an argument of the scale_fill_distiller
line but I get an error message that says one argument (i.e. x
) is missing. I also tried using .
as x
, but got the following error message
Error in rescale(., to = c(0.3, 0.6), from = c(0, 1)) :
object '.' not found
Data available here, in case of need.
Thanks!