pal_brewer | R Documentation |
Colour Brewer palette (discrete)
pal_brewer(type = "seq", palette = 1, direction = 1)
brewer_pal(type = "seq", palette = 1, direction = 1)
type |
One of "seq" (sequential), "div" (diverging) or "qual" (qualitative) |
palette |
If a string, will use that named palette. If a number, will
index into the list of palettes of appropriate |
direction |
Sets the order of colours in the scale. If 1, the default,
colours are as output by |
show_col(pal_brewer()(10))
show_col(pal_brewer("div")(5))
show_col(pal_brewer(palette = "Greens")(5))
# Can use with gradient_n to create a continuous gradient
cols <- pal_brewer("div")(5)
show_col(pal_gradient_n(cols)(seq(0, 1, length.out = 30)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.