labelStack | R Documentation |
Add labels to a plotted image stack
labelStack( x, labels = TRUE, nx, col = "white", offset = c(0.95, 0.05), adj = c(1, 1), ... )
x |
A recently plotted |
labels |
Either a |
nx |
The number of frames in the x-direction of the image stack. If missing, a square tile of images will be assumed. |
col |
Color of the label to be added. |
offset |
A numeric vector of length 1 or 2 specifying the position
of the label in each frame with default values of |
adj |
One or two values in [0, 1] which specify the |
... |
Additional values passed to |
This code is called after having plotted an Image
object, typically
by plotStack
or plot(img, all = TRUE)
. If labels
is TRUE
, each frame of the image will be labeled by frame number.
If FALSE
, no labeling will occur. Otherwise, labels generated by
as.graphicsAnnot
will be placed in the top right corner of each frame
by default or according to offset
and adj
.
The image x
is invisibly returned to permit passing the argument through
a pipe. This function primarily called to label a plotted image.
plotStack
, which allows for automatically labeling the plotted
image and locatorStack
, which provides an interface for
selecting frames from the stack.
lighthouse <- readImage(system.file("extdata", "lighthouse.jpg", package="EBImageExtra")) x <- EBImage::untile(lighthouse, c(4, 3), lwd = 0) idx <- sample(1:12) plotStack(x[,,,idx], label = TRUE) labelStack(x, labels = paste("Original:", idx), offset = 0.5, adj = 0.5, col = "yellow")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.