colorConesa {RColorConesa} | R Documentation |
Retrieve Colors from ConesaLab's Palettes
Description
The colorConesa
function facilitates the extraction of a specified number of colors from the ConesaLab's curated color palettes. This function is designed to obtain a set of colors for their scientific visualizations.
Usage
colorConesa(n, reverse = FALSE, palette = "complete")
Arguments
n |
An integer specifying the number of colors to be extracted from the chosen palette. |
reverse |
A logical value indicating whether the colors in the selected palette should be reversed (Default: |
palette |
A character string specifying the name of the desired palette from the |
Details
ConesaLab's color palettes, available within the package, are tailored for scientific data visualization. The colorConesa
function is built upon these palettes, offering flexibility in color selection based on the user's requirements. It integrates with the palette
argument to choose the color thematic.
It's essential to note that if the requested number of colors (n
) is less than or equal to the size of the chosen palette, the function will directly extract the colors without interpolation. However, if n
surpasses the palette size, interpolation is employed to generate the required colors.
Value
A character vector of colors corresponding to the specified number and palette.
Author(s)
Pedro Salguero Garcia. Maintainer: pedsalga@upv.edu.es
Examples
library(ggplot2)
data("iris")
colorSpecies <- colorConesa(3, palette = "cold")
plot(x = iris$Sepal.Length, y = iris$Sepal.Width, col = colorSpecies[iris$Species], pch = 16)