Skip to contents

Computes limits for 1D and 2D displays adding 10% of margins around the extreme values.

Usage

setlimits1D(mini, maxi, origin, includeOr)
setlimits2D(minX, maxX, minY, maxY, origin = c(0, 0), aspect.ratio = "iso", includeOr)

Arguments

mini

the smallest value of a unidimensional dataset

maxi

the largest value of a unidimensional dataset

minX

the smallest value of the first dimension of a bidimensional dataset

maxX

the largest value of the first dimension of a bidimensional dataset

minY

the smallest value of the second dimension of a bidimensional dataset

maxY

the largest value of the second dimension of a bidimensional dataset

origin

a value (in setlimits1D) or a two-length vector (in setlimits2D) indicating origin coordinate(s)

aspect.ratio

a character string to control physical aspect ratio of the graphic. iso for isometric scales, fill for drawing as big as possible or xy for banking rule

includeOr

a boolean value indicating whether the origin is included in the graphics window

Value

setlimits1D returns a two-length vector containing the limits of the graphics window on one axis.
setlimits2D returns a two-length list where the first element, named xlim, contains a two-length vector containing the limits of the graphics window on the first axis and the second, named ylim, contains the limits on the second axis.

Author

Alice Julien-Laferriere, Aurelie Siberchicot aurelie.siberchicot@univ-lyon1.fr and Stephane Dray

Examples

setlimits1D(mini = -2, maxi = 2, origin = 0, includeOr = TRUE)
#> [1] -2.4  2.4
setlimits2D(minX = -2, maxX = 2, minY = -3, maxY = 4, origin = c(0, 0), includeOr = TRUE)
#> $xlim
#> [1] -4.2  4.2
#> 
#> $ylim
#> [1] -3.7  4.7
#>