Description Usage Arguments Details Examples
Works like RcolorBrewer::brewer.pal
but always returns exactly as many
colours as requested.
1 |
n |
Number of difference colours in the palette. Any positive integer. |
name |
ColorBrewer palette name - see |
Uses grDevices::colorRamp
to produce large colour palettes (more than
9 colours) by interpolating ones returned by RColorBrewer::brewer.pal
.
Because of this very large colour palettes will be difficult to distinguish.
1 2 3 4 5 6 7 8 9 10 11 12 | # Make a colour palette with exactly 2 colours
colours <- make_colour_palette(2, "PuBu")
length(colours) == 2
# Compare to RColorBrewer's minimum of 3 colours
colours_brewer <- RColorBrewer::brewer.pal(2, "PuBu")
length(colours_brewer) == 2
# Making palettes with more than 9 colours
colours <- make_colour_palette(11, "PuBu")
length(colours) == 11
colours_brewer <- RColorBrewer::brewer.pal(11, "PuBu")
length(colours_brewer) == 11
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.