1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/set_palette.R
\name{set_palette}
\alias{set_palette}
\alias{change_palette}
\alias{color_palette}
\alias{fill_palette}
\title{Set Color Palette}
\usage{
set_palette(p, palette)
change_palette(p, palette)
color_palette(palette = NULL, ...)
fill_palette(palette = NULL, ...)
}
\arguments{
\item{p}{a ggplot}
\item{palette}{Color palette. Allowed values include: \itemize{ \item
\strong{Grey color palettes}: "grey" or "gray"; \item \strong{RColorBrewer
palettes}, see \code{\link[RColorBrewer:ColorBrewer]{brewer.pal}} and details section.
Examples of palette names include: "RdBu", "Blues", "Dark2", "Set2", ...;
\item \strong{Custom color palettes}. For example, palette = c("#00AFBB",
"#E7B800", "#FC4E07"); \item \strong{ggsci scientific journal palettes},
e.g.: "npg", "aaas", "lancet", "jco", "ucscgb", "uchicago", "simpsons" and
"rickandmorty". }}
\item{...}{other arguments passed to ggplot2 scale_color_xxx() and
scale_fill_xxx() functions.}
}
\description{
\itemize{ \item \code{change_palette(), set_palette()}: Change
both color and fill palettes. \item \code{color_palette()}: change color
palette only. \item \code{fill_palette()}: change fill palette only.
}
}
\examples{
# Load data
data("ToothGrowth")
df <- ToothGrowth
# Basic plot
p <- ggboxplot(df, x = "dose", y = "len",
color = "dose")
p
# Change the color palette
set_palette(p, "jco")
}
\seealso{
\link{get_palette}.
}
|