show_palettes: Show the color palettes

View source: R/SCP-plot.R

show_palettesR Documentation

Show the color palettes

Description

This function displays color palettes using ggplot2.

Usage

show_palettes(
  palettes = NULL,
  type = c("discrete", "continuous"),
  index = NULL,
  palette_names = NULL,
  return_names = TRUE,
  return_palettes = FALSE
)

Arguments

palettes

A list of color palettes. If 'NULL', uses default palettes.

type

A character vector specifying the type of palettes to include. Default is "discrete".

index

A numeric vector specifying the indices of the palettes to include. Default is 'NULL'.

palette_names

A character vector specifying the names of the SCP palettes to include. Default is 'NULL'.

return_names

A logical value indicating whether to return the names of the selected palettes. Default is 'TRUE'.

return_palettes

A logical value indicating whether to return the colors of selected palettes. Default is 'FALSE'.

See Also

palette_scp palette_list

Examples

show_palettes(palettes = list(c("red", "blue", "green"), c("yellow", "purple", "orange")))
all_palettes <- show_palettes(return_palettes = TRUE)
names(all_palettes)
all_palettes[["simspec"]]
show_palettes(index = 1:10)
show_palettes(type = "discrete", index = 1:10)
show_palettes(type = "continuous", index = 1:10)
show_palettes(palette_names = c("Paired", "nejm", "simspec", "Spectral", "jet"), return_palettes = TRUE)


zh542370159/SCP documentation built on Nov. 22, 2023, 2:34 a.m.