Files
jaredandClaude Sonnet 5.5 f3ec052144
R-CMD-check / R CMD check (push) Successful in 4m38s
fix(logo): reserve a logo band in add_logo_ga() instead of a negative margin (#28)
add_logo_ga() now gives the logo its own band (logo_height inches) below the
plots, as add_logo() does, and leaves plot margins alone unless margin_param
is given.

Closes #28

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 15:39:43 -04:00

54 lines
1.4 KiB
R

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/logo.R
\name{add_logo_ga}
\alias{add_logo_ga}
\title{Add a logo to multiple ggplot2 objects}
\usage{
add_logo_ga(
plot_list,
logo,
nrow = 1,
widths = NULL,
margin_param = NULL,
font_scale = 1,
logo_height = 0.5
)
}
\arguments{
\item{plot_list}{a list containing ggplot2 objects}
\item{logo}{a grob containing the logo created with `make_logo_grob`}
\item{nrow}{an integer, default = 1, for the number of rows to align the plots in}
\item{widths}{an optional vector the same length as plot_list with the widths for each plot}
\item{margin_param}{Optional number. Replaces the bottom plot margin (in points).
`NULL` (default) leaves plot margins alone.}
\item{font_scale}{Numeric. Multiplicative scaling factor applied to text
sizes before composing. Default `1`. See [add_logo()] for details.}
\item{logo_height}{Numeric. Height in inches of the band reserved for the
logo below the plots. Default `0.5`.}
}
\value{
a grid object
}
\description{
Add a logo to multiple ggplot2 objects
}
\note{
The resulting object needs to be drawn to the screen using grid.draw()
}
\examples{
\dontrun{
library(ggplot2); library(grid)
tmp_plot <- ggplot(mtcars) + aes(x = hp, y = disp) + geom_point() + theme_civilytics()
tmp_logo <- make_logo_grob()
plot_and_logo <- add_logo(tmp_plot, tmp_logo)
grid.draw(plot_and_logo)
dev.off()
}
}