Description Usage Arguments Examples
View source: R/choose_palette_br.R
It generates a discrete palette with the number of colors available in the palette. If discrete = FALSE, a continuous palette is generated by linear interpolation (1:n) of the colors available in the palette.
1 | tanagr_palette(palette_name, n, discrete = TRUE)
|
palette_name |
the name of the palette |
n |
number of colors requested (discrete). Number of colors for interpolation (continuous). |
discrete |
whether to use a discrete or continuous color palette (boolean) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | pal = tanagr_palette("bangsia_edwardsi")
data(iris)
plot(iris$Sepal.Width,
iris$Sepal.Length,
col = pal[as.numeric(iris$Species)],
pch = 19,
cex = 2)
pal = tanagr_palette("dacnis_berlepschi", n = 20, discrete = FALSE)
data(volcano)
image(volcano,
col = pal,
main = "Colors: Dacnis berlepschi")
#Change length of interpolation vector
pal = tanagr_palette("dacnis_berlepschi", n = 100, discrete = FALSE)
image(volcano,
col = pal,
main = "Colors: Dacnis berlepschi")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.