Add tags and a caption to a fig.
fig_tag(
plot,
tag,
pos = "topleft",
x_nudge = 0,
y_nudge = 0,
colour = NULL,
alpha = NULL,
hjust = NULL,
vjust = NULL,
fontsize = 12,
fontface = NULL,
fontfamily = NULL
)
Plot from img2plot function.
Label to add to plot.
Position of label (Default 'topleft').
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).
Colour of label text.
Alpha of label text.
hjust of plot label.
vjust of plot label.
Fontsize of label (in points).
The font face (bolt, italic, ...)
Fontfamily of plot label.
{ggplot2} object
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)
# Add tags on top of the figs
img1 <- fig_tag(img, "A")
img2 <- fig_tag(img, "B", pos = "topright")
# assemble the patchwork
patchwork::wrap_plots(img1, img2)