Learn R Programming

addScales (version 1.0-1)

scaleline: Extract scaleline list from scaledTrellis object

Description

Extracts the scaleline list from an object inheriting from class scaledTrellis. This is useful if the user wants to create their own legend rather than using that generated by addScales.

Usage

scaleline(obj, …)
# S3 method for scaledTrellis
scaleline(obj, …)

Arguments

obj

scaledTrellis object

Possible further arguments for future methods. Ignored at present.

Value

A list with components:

h

numeric: distance between horizontal scalelines and midline

v

numeric: distance between vertical scalelines and midline

Details

Extracts the scaleline list from a scaledTrellis object. Note that the actual calculated values are returned, not the rounded/formatted values that would be shown in the legend.

See Also

addScales

Examples

Run this code
# NOT RUN {
set.seed(8763)
simp <- xyplot(rnorm(10) ~ runif(10))
## Plot it
simp

## Add horizontal and vertical scale lines
ad <-addScales(simp,
 scaleline = TRUE,,
 ndig.midline = 1  ## only 1 digit will be shown
)
## Plot it
ad

## But here are the actual values
## (shown to default number of digits given
## by "digits" argument of print.default)
scaleline(ad)

## cleanup
rm(simp, ad)
# }

Run the code above in your browser using DataLab