labeller | R Documentation |
Adds a figure label or sub label to an existing plot.
labeller(
fig = NULL,
sub = NULL,
side = 3L,
pad = NULL,
at = c(0.05, 0.9),
args.fig = list(),
args.sub = list(),
args.rect = list()
)
fig , sub |
labels for the upper left corner and panel, respectively;
note that |
side |
the side of the plot to draw the |
pad |
(optional) height of the sub label space as a fraction of the
length of the axis perpendicular to |
at |
the x- and y-locations of |
args.fig , args.sub , args.rect |
a named list of additional
arguments passed to |
op <- par(mar = c(5, 5, 5, 5))
plot(1, ylim = c(0, 100))
labeller(fig = 'A')
labeller(fig = 'A', at = c(0.025, 0.9), args.fig = list(font = 2, cex = 2))
labeller(sub = 'this is a\nplot label')
labeller(sub = 'plot label', side = 4)
labeller(sub = 'pad = -0.1', side = 2, pad = -0.1)
labeller(
sub = 'plot label', side = 1,
args.sub = list(cex = 3, font = 2, col = 'white'),
args.rect = list(col = 'red', lwd = 3, border = 'orange', lty = 2)
)
par(op)
op <- par(mfrow = c(2, 3))
sapply(1:6, function(ii) {
plot(1)
fig <- names(plotr::fig(ii, par('mfrow')))
labeller(LETTERS[ii], sprintf('Panel %s', ii), side = 3L + grepl('right', fig))
})
par(op)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.