imscalebar: Make a scalebar to accompany an image.im3d plot

View source: R/im3d.R

imscalebarR Documentation

Make a scalebar to accompany an image.im3d plot

Description

Make a scalebar to accompany an image.im3d plot

Usage

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 ths plot

border

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

...

Additional arguments for plot

Examples

## Not run: 
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)

## End(Not run)

nat documentation built on May 29, 2024, 10:36 a.m.