% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/scale_ipea.R
\name{scale_fill_ipea}
\alias{scale_fill_ipea}
\title{Scale fill IPEA}
\usage{
scale_fill_ipea(
  palette = c("Blue", "Green", "Orange", "Pink", "Pink-Deep", "Green-Blue",
    "Green-Blue-White", "Red-Blue", "Red-Blue-White", "Orange-Blue", "Orange-Blue-White",
    "Viridis", "Inferno", "Magma", "Plasma", "Cividis", "NT", "NT-Categorical", "TD",
    "TD-Categorical"),
  palette_direction = 1,
  decimal.mark = ",",
  barheight = NULL,
  barwidth = NULL,
  title.hjust = NULL,
  label.hjust = NULL,
  ...
)
}
\arguments{
\item{palette}{A character vector specifying the available palette for the
color palette. The default palette are \code{"Blue"}, but we can also change
to \code{'Green'}, \code{'Orange'}, \code{'Pink'}, \code{'Pink-Deep'}, \code{'Red-Blue'}, \code{'Orange-Blue'}, \code{'Green-Blue'},
\code{'Red-Blue-White'}, \code{'Orange-Blue-White'}, \code{'Green-Blue-White'},
\code{'Viridis'}, \code{'Inferno'}, \code{'Magma'}, \code{'Plasma'}, \code{'Cividis'}, \code{'NT'}, \code{'TD'}.
\code{'NT'} and \code{'TD'} automatically switch from their sequential (continuous)
colours to a 12-colour qualitative set when the mapped variable is
discrete -- there is no need to request \code{'NT-Categorical'}/\code{'TD-Categorical'}
directly, though those names remain available for \code{ipea_pal()}/\code{ipea_palette()}.}

\item{palette_direction}{A logical argument specifying if the ordering of the colors
will follow the default of the palette (when the argument is 1) or if it will
have an inverted ordering (for cases where it is 0).}

\item{decimal.mark}{The character to be used to indicate the numeric decimal point and
Character used between every 3 digits to separate thousands.
By default, the function uses a comma \code{","}, following
the format used in Brazilian Portuguese.}

\item{barheight}{The height of the color gradient bar. This parameter is used
when the direction is set to "horizontal".}

\item{barwidth}{The width of the color gradient bar. This parameter is used
when the direction is set to "horizontal".}

\item{title.hjust}{A number specifying horizontal justification of the title text.}

\item{label.hjust}{A number specifying vertical justification of the title text.}

\item{...}{Additional arguments to be passed to the scale_fill_gradientn,
scale_color_gradientn, scale_fill_distiller or scale_color_distiller
function from the ggplot2 package}
}
\value{
A list object be added to a ggplot object to change color pallete.
}
\description{
Generate a fill palette (continuous or discrete) in the
formatting of texts published by the Institute for Applied
Economic Research (IPEA)
}
\examples{
# Creating scale for ggplot2 graph using default arguments
library(ggplot2)
fig_raw <- ggplot() +
  geom_col(data = mtcars, aes(x = hp , y = mpg, fill = cyl)) +
  scale_fill_ipea()

# Creating scale for ggplot2 graph using green sequential palette
fig_raw <- ggplot() +
  geom_col(data = mtcars, aes(x = hp , y = mpg, fill = cyl)) +
  scale_fill_ipea(palette = "Green")

# "TD" uses the sequential blue ramp for a numeric variable, and the
# 12-colour qualitative set for a discrete one, automatically
fig_raw <- ggplot() +
  geom_col(data = mtcars, aes(x = hp , y = mpg, fill = factor(cyl))) +
  scale_fill_ipea(palette = "TD")
}
\seealso{
Other ggplot2 theme functions:
\code{\link[=ipea_contrast_color]{ipea_contrast_color()}},
\code{\link[=ipea_label_size]{ipea_label_size()}},
\code{\link[=scale_color_ipea]{scale_color_ipea()}},
\code{\link[=theme_ipea]{theme_ipea()}}
}
\concept{ggplot2 theme functions}
