% Generated by roxygen2: do not edit by hand % Please edit documentation in R/logo.R \name{civilytics_logo} \alias{civilytics_logo} \title{Add a Civilytics logo to a ggplot (pipe-friendly)} \usage{ civilytics_logo( plot, type = c("wordmark", "mark"), variant = c("light", "dark"), position = c("bottom-right", "bottom-left", "top-right", "top-left"), margin_param = NULL, font_scale = 1, logo_height = 0.5 ) } \arguments{ \item{plot}{A ggplot object.} \item{type}{Character. `"wordmark"` (default) or `"mark"`. Passed to [make_logo_grob()].} \item{variant}{Character. `"light"` (default) or `"dark"`. Passed to [make_logo_grob()].} \item{position}{Character. Corner placement for the logo: `"bottom-right"` (default), `"bottom-left"`, `"top-right"`, or `"top-left"`.} \item{margin_param}{Numeric or `NULL`. Manual margin adjustment passed to [add_logo()].} \item{font_scale}{Numeric. Multiplies the plot's base text size before composing. Default `1` leaves typography unchanged.} \item{logo_height}{Numeric. Height in inches of the band reserved for the logo. Default `0.5`.} } \value{ A grob (from [gridExtra::arrangeGrob()]) ready to draw with [grid::grid.draw()]. } \description{ A convenience wrapper that creates the logo grob and attaches it to a corner of the plot in one call. Designed for use with the base pipe `|>`. } \details{ **Important:** R's `|>` has *higher* precedence than `+`, so you must wrap the ggplot chain in parentheses before piping: ``` (ggplot(mpg, aes(displ, hwy)) + geom_point() + theme_civilytics()) |> civilytics_logo() ``` } \examples{ \dontrun{ library(ggplot2); library(grid) # Pipe usage — parentheses required around the ggplot chain (ggplot(mpg, aes(displ, hwy)) + geom_point() + theme_civilytics()) |> civilytics_logo() |> grid.draw() # Top-right placement (ggplot(mpg, aes(displ, hwy)) + geom_point() + theme_civilytics()) |> civilytics_logo(position = "top-right") |> grid.draw() # Bottom-left with mark (ggplot(mpg, aes(displ, hwy)) + geom_point() + theme_civilytics()) |> civilytics_logo(type = "mark", position = "bottom-left") |> grid.draw() # Dark theme with mark in top-left (ggplot(mpg, aes(displ, hwy)) + geom_point() + theme_civilytics_dark()) |> civilytics_logo(variant = "dark", type = "mark", position = "top-left") |> grid.draw() } }