Low-Level Plotting Function

DESCRIPTION:

Convert from top-level user coordinates to the coordinates that the lower-level plotting functions think of as user coordinates, using a piecewise-linear coordinate system. Primarily used for axis breaks and non-numeric plotting (e.g. calendar time series).

USAGE:

user.to.plot(pts, scale=NULL) 

REQUIRED ARGUMENTS:

pts
the points, in high-level user coordinates, to convert.

OPTIONAL ARGUMENTS:

scale
the scale to use. Either NULL if the points are not to be scaled, or a 2-element list where the first element is a monotonic sequence in user-coordinates giving the endpoints of the linear regions, and the second element is the (numeric) plot coordinates of those points. Coordinates which lie outside the scale region will be moved to the ends and a warning will generated. pts and the first component of scale need not be numeric but they must have addition and subtraction operators.

VALUE:

the points in plot coordinates.

DETAILS:

The points are converted using simple arithmetic to interpolate linearly.

SEE ALSO:

.

EXAMPLES:

# no scaling 
user.to.plot(1:10, NULL) 
# map 0-20 in user coordinates into 0-1 in plot coordinates 
user.to.plot(1:10, list(c(0,20),c(0,1))) 
# map time/date object to numbers 
user.to.plot(as(1:10, "timeDate"), list(as(c(0,10), "timeDate"), c(0,1)))