Title: | A Color Palette for NOAA Fisheries |
---|---|
Description: | This is a package that implements a color palette in line with the NOAA Fisheries Branding Guide. |
Authors: | Christine Stawitz [aut], Bai Li [aut], Kathryn Doering [ctb], Sophie Breitbart [cre], Steve Saul [ctb], Sam Schiano [ctb] |
Maintainer: | Sophie Breitbart <[email protected]> |
License: | GPL-3 | file LICENSE |
Version: | 3.0.0.000 |
Built: | 2025-01-15 21:18:43 UTC |
Source: | https://github.com/nmfs-fish-tools/nmfspalette |
Return function to interpolate a nmfs color palette
display_nmfs_palette(name, n, ...)
display_nmfs_palette(name, n, ...)
name |
Character name of palette in nmfs_palettes |
n |
Number of colors in palette |
... |
Additional arguments to pass to image() |
display_nmfs_palette("oceans", 10)
display_nmfs_palette("oceans", 10)
Function to extract nmfs colors as hex codes
nmfs_cols(...)
nmfs_cols(...)
... |
Character names of nmfs_colors |
nmfs_cols("processblue")
nmfs_cols("processblue")
Return function to interpolate a nmfs color palette
nmfs_palette(palette = "oceans", reverse = FALSE, ...)
nmfs_palette(palette = "oceans", reverse = FALSE, ...)
palette |
Character name of palette in nmfs_palettes |
reverse |
Boolean indicating whether the palette should be reversed |
... |
Additional arguments to pass to colorRampPalette() |
nmfs_palette("oceans")(10)
nmfs_palette("oceans")(10)
The nmfspalette package provides functions to extract colors, color palettes, and use ggplot2 palettes in R.
This package contains functions to support graphing in base R and ggplot2 using NOAA Fisheries colors.
Maintainer: Sophie Breitbart [email protected]
Authors:
Christine Stawitz [email protected]
Bai Li [email protected]
Other contributors:
Kathryn Doering [email protected] [contributor]
Steve Saul [email protected] [contributor]
Sam Schiano [email protected] [contributor]
Color scale constructor for nmfs colors
scale_color_nmfs(palette = "oceans", discrete = TRUE, reverse = FALSE, ...)
scale_color_nmfs(palette = "oceans", discrete = TRUE, reverse = FALSE, ...)
palette |
Character name of palette in nmfs_palettes |
discrete |
Boolean indicating whether color aesthetic is discrete or not |
reverse |
Boolean indicating whether the palette should be reversed |
... |
Additional arguments passed to discrete_scale() or scale_color_gradientn(), used respectively when discrete is TRUE or FALSE |
## Not run: ggplot(iris, aes(Sepal.Width, Sepal.Length, color = Species)) + geom_point(size = 4) + scale_color_nmfs("coral") ## End(Not run)
## Not run: ggplot(iris, aes(Sepal.Width, Sepal.Length, color = Species)) + geom_point(size = 4) + scale_color_nmfs("coral") ## End(Not run)
Fill scale constructor for nmfs colors
scale_fill_nmfs(palette = "oceans", discrete = TRUE, reverse = FALSE, ...)
scale_fill_nmfs(palette = "oceans", discrete = TRUE, reverse = FALSE, ...)
palette |
Character name of palette in nmfs_palettes |
discrete |
Boolean indicating whether color aesthetic is discrete or not |
reverse |
Boolean indicating whether the palette should be reversed |
... |
Additional arguments passed to discrete_scale() or scale_fill_gradientn(), used respectively when discrete is TRUE or FALSE |
## Not run: ggplot(mpg, aes(manufacturer, fill = manufacturer)) + geom_bar() + theme(axis.text.x = element_text(angle = 45, hjust = 1)) + scale_fill_nmfs(palette = "crustacean", discrete = FALSE) ## End(Not run)
## Not run: ggplot(mpg, aes(manufacturer, fill = manufacturer)) + geom_bar() + theme(axis.text.x = element_text(angle = 45, hjust = 1)) + scale_fill_nmfs(palette = "crustacean", discrete = FALSE) ## End(Not run)