Quickly arrange and label multiple figs.
fig_wrap(
figs,
tag = NULL,
prefix = NULL,
suffix = NULL,
pos = "topleft",
x_nudge = 0,
y_nudge = 0,
nrow = NULL,
ncol = NULL,
colour = NULL,
alpha = NULL,
hjust = NULL,
vjust = NULL,
fontsize = NULL,
fontfamily = NULL,
fontface = NULL,
b_col = NULL,
b_size = 1,
b_pos = "offset",
b_margin = ggplot2::margin(4, 4, 4, 4)
)
List of figs from fig()
.
Tags to be applied to figs. Begins with first uppercase or lowercase letter supplied, or number, and continues the sequence. "A" labels them 'A', 'B', etc. "c" labels them 'c', 'd', 'e' etc.
Prefix for each tag
Suffix for each tag
Position for label, to be passed to fig_tag()
.
Minor adjustments to the x position in relative plot coordindates (0 being furthest left, 1 being furthest right).
Minor adjustments to the y position in relative plot coordinates (0 being the bottom, 1 being the top).
Number of rows in final patchwork.
Number of cols in final patchwork.
Colour for each tag
Alpha for each tag
hjust for each tag
vjust for each tag
Fontsize for each tag
Fontfamily for each tag
Fontface for each tag
Colour of individual fig borders.
Size of individual fig borders (in mm).
Either "offset" and expanding outwards from borders of figure, or "inset" and expanding inwards and partially covering the figure.
Margins to adjust around the figs. Use
ggplot2::margin()
patchwork
patch of supplied figs.
library(figpatch)
library(ggplot2)
# Attach the fig image file
image <- system.file("extdata", "fig.png", package = "figpatch", mustWork = TRUE)
# Read in the image as a 'fig'
img <- fig(image)
# multiple figs
figs <- lapply(1:9, function(x) img)
# wrap the figs
fig_wrap(figs)
# Wrap the figs and auto-tag
fig_wrap(figs, tag = "A", suffix = ")")
# Wrap figs, auto-tag and adds border.
fig_wrap(figs, tag = 1, prefix = "(", suffix = ")", b_col = "black")