Skip to contents

Visualize a palette using various plot styles.

Usage

preview_palette(
  name,
  type = NULL,
  n = NULL,
  plot_type = c("bar", "pie", "point", "rect", "circle"),
  title = NULL
)

Arguments

name

Character. Name of the palette.

type

Character. One of "sequential", "diverging", "qualitative". If NULL, auto-detected.

n

Integer. Number of colors to use. If NULL, uses all. Default: NULL.

plot_type

Character. One of "bar", "pie", "point", "rect", "circle". Default: "bar".

title

Character. Plot title. If NULL, defaults to palette name.

Value

Invisibly returns NULL. Called for plotting side effect.

Examples

# \donttest{
preview_palette("seq_blues", plot_type = "bar")

preview_palette("div_fireice", plot_type = "pie")

preview_palette("qual_vivid", n = 4, plot_type = "circle")

# }