Make a scalebar to accompany an image.im3d plot

imscalebar(
  levels,
  col,
  nlevels = NULL,
  zlim = NULL,
  horizontal = TRUE,
  lab = "Density",
  mar = c(4, 2, 2, 2) + 0.1,
  border = NULL,
  ...
)

Arguments

levels

The levels at which z values were cut or a list returned by image.im3d

col

The plotted colours for each level

nlevels

The number of colour levels (inferred from levels when NULL)

zlim

The limits of the plotted z (intensity) values of the image

horizontal

Whether to make a horizontal or vertical scalebar (default: TRUE)

lab

The (single) axis label for the scale bar (default: Density)

mar

The margins for this plot

border

Color for rectangle border (see rect's border argument for details).

...

Additional arguments for plot

Examples

if (FALSE) {
LHMask=read.im3d(system.file('tests/testthat/testdata/nrrd/LHMask.nrrd',package='nat'))
op=par(no.readonly = TRUE)
layout(matrix(c(1, 2), ncol = 2L), widths = c(1, 0.2))
rval=image(imslice(LHMask,10), asp=TRUE)
imscalebar(rval)
par(op)
}