View source: R/bi_scale_color.R
| bi_scale_color | R Documentation | 
Applies the selected palette as the color aesthetic when geom_sf
is used and the bi_class variable is given as the color in the aesthetic
mapping.
bi_scale_color(pal, dim = 3, flip_axes = FALSE, rotate_pal = FALSE, ...)
| pal | A palette name or a vector containing a custom palette. See
the help file for  | 
| dim | The dimensions of the palette. To use the built-in palettes,
this value must be either  If you are using a custom palette, this value may be larger (though these
maps can be very hard to interpret). See the 'Advanced Options' vignette
for details on the relationship between  | 
| flip_axes | A logical scalar; if  | 
| rotate_pal | A logical scalar; if  | 
| ... | Arguments to pass to  | 
A ggplot object with the given bivariate palette applied to the data.
bi_pal
# load dependencies
library(ggplot2)
# add breaks, 3x3
data <- bi_class(stl_race_income, x = pctWhite, y = medInc, style = "quantile", dim = 3)
# create map
plot <- ggplot() +
  geom_sf(data = data, aes(color = bi_class), size = 2, show.legend = FALSE) +
  bi_scale_color(pal = "GrPink", dim = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.