Create theme for nmfs colors
theme_nmfs(
palette = "oceans",
discrete = TRUE,
reverse = FALSE,
interpolate = TRUE,
base_size = 14,
lab_size = 12,
ink = "black",
paper = "white",
accent = "#003087",
...
)Character name of palette in nmfs_palettes. Default value
is "oceans".
Boolean indicating whether color aesthetic is discrete. Default is TRUE.
Boolean indicating whether the palette should be reversed. Default is FALSE.
Boolean indicating whether the colors assigned to plot objects should interpolated from palettes, with the alternative that only the defined colors in the palette are used. Default is TRUE.
The base font size, as defined in the
ggplot2::theme_gray() function
The axis text size
The plot foreground color, as defined in the
ggplot2::theme_gray() function
The plot background color, as defined in the
ggplot2::theme_gray() function
The plot's accented elements' color, as defined in the
ggplot2::theme_gray() function
Additional arguments passed to: ggplot2::scale_fill_gradientn()
when discrete is TRUE; ggplot2::discrete_scale() when discrete is FALSE
and interpolate is TRUE; and ggplot2::scale_fill_manual() when discrete
is FALSE and interpolate is FALSE.
A theme that applies nmfs color palettes and theme-related elements (such as label sizes, borders, axis lines, and more) to a plot. For more information about the ggplot2 advances that enabled this function, check out the ggplot2 version 4.0.0 release notes.
library(ggplot2)
ggplot(mtcars, aes(x = mpg, y = disp, color = as.factor(cyl))) +
geom_point(size = 3) +
theme_nmfs(discrete = TRUE, interpolate = TRUE, palette = "crustacean")
ggplot(mtcars, aes(x = mpg, y = disp, color = as.factor(cyl))) +
geom_point(size = 3) +
theme_nmfs(discrete = TRUE, interpolate = FALSE, palette = "crustacean")
#> ℹ The crustacean palette has 4 colors.
ggplot(mtcars, aes(x = mpg, y = disp, fill = hp)) +
geom_point(size = 3, shape = 24) +
theme_nmfs(discrete = FALSE, interpolate = TRUE, palette = "seagrass")