Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

panel.scaleArrow

Draw a scale bar as an arrow, labelled with its length in plot units.


Description

Draw a scale bar as an arrow, labelled with its length in plot units.

Usage

panel.scaleArrow(x = unit(0:1, "npc"), y = unit(0:1, "npc"),
                 default.units = "npc",
                 digits = 0, append = "", label = NULL,
                 angle = 30, length = 0.5, unit = "char",
                 type = "open", ends = "both",
                 ...,
                 col = add.line$col, fill = col, alpha = add.line$alpha,
                 lty = add.line$lty, lwd = add.line$lwd,
                 col.text = add.text$col, alpha.text = add.text$alpha)

Arguments

x, y, default.units

coordinates of the line ends as grid units or otherwise interpreted in default.units.

digits

number of decimal places to keep for the distance measure.

append

a string to append to the distance for the label.

label

label to place on the mid point of the scale, over-riding the default.

angle, length, unit, type, ends

specification of the arrow style; see panel.arrows.

...

further arguments passed to panel.text. You will need at least the pos or adj arguments.

col, fill, alpha, lty, lwd

graphical parameters relevant to the line.

col.text, alpha.text

graphical parameters relevant to the text label. Others like cex and font can be passed though ....

Author(s)

Felix Andrews felix@nfrac.org

See Also

Examples

xyplot(EuStockMarkets) +
  layer(panel.scaleArrow(x = 0.99, append = " units",
          col = "grey", srt = 90, cex = 0.8))

latticeExtra

Extra Graphical Utilities Based on Lattice

v0.6-29
GPL (>= 2)
Authors
Deepayan Sarkar <deepayan.sarkar@r-project.org>, Felix Andrews <felix@nfrac.org>
Initial release
2019-12-18

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.