Skip to contents

urban_inks() returns the spot-colour inks of a palette, named by the role each ink plays on a plate. scale_colour_urban() and scale_fill_urban() use the four data inks, in that order, for a discrete variable.

Usage

urban_inks(palette = NULL)

scale_colour_urban(..., palette = NULL, aesthetics = "colour")

scale_color_urban(..., palette = NULL, aesthetics = "colour")

scale_fill_urban(..., palette = NULL, aesthetics = "fill")

Arguments

palette

One of "brick", "atlas", or "harvest". The default is the nycggurban.palette option, or "brick" if that is unset.

...

Other arguments passed on to ggplot2::discrete_scale().

aesthetics

The aesthetics the scale applies to.

Value

urban_inks() returns a named character vector of hex colours. The scale functions return a ggplot2 scale.

Palettes

  • "brick", the default, stays close to the 1966 inks but remains legible under red-green colour-vision deficiency: a brick red, a lighter blue, a dark plum, and the original leaf green.

  • "atlas" is the original ink set, sampled from scans of the Urban Atlas. Its blue and purple are hard to tell apart under red-green colour-vision deficiency.

  • "harvest" is an earth-tone alternative that also remains legible under colour-vision deficiency: burnt orange, navy, umber, and teal.

All three share the tan base-map ink and the off-white paper.

Roles

  • density: residential population density.

  • income: personal income.

  • built: industrial and commercial land.

  • open: parks, institutions, airports, and cemeteries.

  • base: base-map line work, neatlines, and panel titles.

  • paper: the background.

Examples

urban_inks()
#>   density    income     built      open      base     paper 
#> "#B8401F" "#1F6FA8" "#4A3548" "#98CE59" "#C3B0A0" "#FDF5EF" 
urban_inks("atlas")[["density"]]
#> [1] "#BF2444"

library(ggplot2)
ggplot(mpg, aes(displ, hwy, colour = drv)) +
  geom_point() +
  scale_colour_urban()