acl_palette()
View source ↗On this page
Return the colors of the ALSCL plots for figures of your own.
Usage
acl_palette(n = NULL, palette = NULL, role = NULL)
Arguments
| Argument | Default | Description |
|---|---|---|
n | NULL | Integer or NULL. Number of colors. NULL returns the native colors of the palette; more colors than the palette holds are interpolated between its colors. |
palette | NULL | Character or NULL. "default", "npg", "aaas", "nejm", "lancet" or "jama"; NULL uses the palette set with |
role | NULL | Character vector or NULL. Names of color roles, "stock", "F", "recruitment", "catch" (the quantity families), "primary" (lines and points), "accent" (observations), "smooth" (smoothers) and "reference" (reference lines). With |
Value
A character vector of colors, named by role when role is given.
Details
Without arguments the function returns the native colors of the active palette, eight for the default palette "default", whose first two colors are dark blue #002b5f and orange #eb5c24. n gives that many colors, interpolated when the palette holds fewer. role returns the colors that the plots use. Under the default style "stock" is #047c6c, "F" #ed5f26, "recruitment" #28b3e8 and "catch" #002b5f; under "classic" these four take the primary color of the palette.
Examples
Run the setup before the example. Fitting examples require an R-compatible C++ toolchain; simulation and export examples may write files.
Example setup
library(ALSCL)
# Use objects defined above
acl_palette()
acl_palette(3)
acl_palette(12, palette = "npg")
acl_palette(role = c("stock", "F", "recruitment", "catch", "primary", "accent"))

for (p in c("default", "npg", "aaas", "nejm", "lancet", "jama")) scales::show_col(acl_palette(palette = p))