Specifying the colour scale for maps in ggplot

后端 未结 2 1605
时光取名叫无心
时光取名叫无心 2020-12-16 12:17

Having difficulty setting the colour scales for maps in ggplot. I need greyscale. Very grateful for an idea where I\'m going wrong. I also wonder if there is a more efficie

2条回答
  •  醉话见心
    2020-12-16 12:24

    You need to use scale_fill_* and not scale_color_*. For the polygon geometry the fill color of the polygons is coupled to the fill aesthetic, not to the color aesthetic. In general, the function used to change the details of a particular scale is scale_aesthetic_name_type_of_scale, e.g. scale_fill_gradient.

提交回复
热议问题