Learn R Programming

ribiosPlot (version 1.3.0)

getLims: Get xlim/ylim ranges for plots from real values

Description

Get xlim/ylim ranges for plots from real values

Usage

getLims(..., perc = 0.99, symm = TRUE)

Value

A numeric vector of length 2 giving the lower and upper axis limits.

Arguments

...

one or more vectors of real values

perc

percentage of dynamic range that should be covered by the limits; if set to 1 the whole range is used.

symm

logical value; if set to TRUE, the range will be symmetric around zero

Examples

Run this code

myX <- rnorm(100, mean=1)
myY <- rnorm(100)
myLim <- getLims(myX, myY, perc=0.99)
plot(myX, myY, xlim=myLim, ylim=myLim)
mySymmLim <- getLims(myX, myY, perc=0.99, symm=TRUE)
plot(myX, myY, xlim=myLim, ylim=mySymmLim)


Run the code above in your browser using DataLab