Skip to contents

Applies the poster's base font size/family to a ggplot's theme, then converts it to a grob.

Usage

card_figure(gg, theme = poster_theme(), width = NULL, height = NULL)

Arguments

gg

A ggplot object.

theme

A poster_theme() object.

width, height

Target size as a grid::unit or millimetres. NULL keeps the plot's natural size.

Value

A grob suitable as the body argument of poster_card().

Examples

g <- card_figure(ggplot2::qplot(1, 1), poster_theme())
#> Warning: `qplot()` was deprecated in ggplot2 3.4.0.