powered by
Map numeric values to a colour map
numeric2col( num, colmap = grDevices::terrain.colors(100), breaks.length = length(colmap) )
A character vector of colours, one for each element of num, selected from colmap according to the discretised numeric values.
num
colmap
A numeric vector. The numbers which will be mapped to colours.
A colour map. See palette.
palette
A single integer. Controls the number of breaks in the discretisation of num.
ns <- 16 sky <- CMBDataFrame(I = rnorm(12*ns^2), nside = ns) plot(sky, col = numeric2col(sky$I))
Run the code above in your browser using DataLab