Description Usage Arguments Value Author(s) Examples
This is helpful in e.g. developing a colour scale for an image plot. It is
not necessary that rlow
be less than rhigh
, and in fact
reversing them is a good way to get a reversed colour scale for a plot.
1 
x 
a numeric vector. 
xlow 

xhigh 

rlow 
value of the result corresponding to 
rhigh 
value of the result corresponding to 
clip 
logical, set to 
A new vector, which has minimum lim[1]
and maximum
lim[2]
.
Dan Kelley
1 2 3 4 5 6 7 8 9 10 11  library(oce)
# Fake towyow data
t < seq(0, 600, 5)
x < 0.5 * t
z < 50 * (1 + sin(2 * pi * t / 360))
T < 5 + 10 * exp(z / 100)
palette < oce.colorsJet(100)
zlim < range(T)
drawPalette(zlim=zlim, col=palette)
plot(x, z, type='p', pch=20, cex=3,
col=palette[rescale(T, xlow=zlim[1], xhigh=zlim[2], rlow=1, rhigh=100)])

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs in the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.