% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ipea_label_size.R
\name{ipea_label_size}
\alias{ipea_label_size}
\title{Font size for data labels in Ipea graphics}
\usage{
ipea_label_size(pt = 6)
}
\arguments{
\item{pt}{Numeric. Desired font size in points. Defaults to \code{6}, the size
used by the editorial guidelines of the Institute for Applied
Economic Research (Ipea) for labels drawn over data (e.g. values on
bars or lines). See
\url{https://www.ipea.gov.br/manualeditorial/padroes/padroes-grafico-visuais/ilustracoes-pi.html}.}
}
\value{
A numeric value (in mm) to be passed to the \code{size}
argument/aesthetic of \code{ggplot2::geom_text()}, \code{ggplot2::geom_label()}
or similar geoms.
}
\description{
Converts a font size in points (pt) into the \code{size}
argument/aesthetic (in mm) expected by \code{ggplot2::geom_text()},
\code{ggplot2::geom_label()} and similar geoms. \code{ggplot2} specifies text size
for geoms in mm and internally converts it to points by multiplying by
\code{2.845276} (\code{72.27/25.4}); this helper performs the inverse conversion so
that labels are rendered at an exact point size.
}
\examples{
library(ggplot2)
ggplot(mtcars[1:5, ], aes(hp, mpg, label = round(mpg))) +
  geom_text(size = ipea_label_size(), colour = "black") +
  theme_ipea()
}
\seealso{
Other ggplot2 theme functions:
\code{\link[=ipea_contrast_color]{ipea_contrast_color()}},
\code{\link[=scale_color_ipea]{scale_color_ipea()}},
\code{\link[=scale_fill_ipea]{scale_fill_ipea()}},
\code{\link[=theme_ipea]{theme_ipea()}}
}
\concept{ggplot2 theme functions}
