Skip to content

Instantly share code, notes, and snippets.

@s-kganz

s-kganz/images.R Secret

Created Jan 16, 2021
Embed
What would you like to do?
Images that compare rainbow and grayscale color maps.
library(fields)
mtx <- rep(0, 10000)
mtx <- matrix(mtx, nrow=100, ncol=100)
for (i in 1:100){
for (j in 1:100){
mtx[i, j] <- i^2 + j^2
}
}
image.plot(
mtx,
col=rainbow(18050)
)
image.plot(
mtx,
col=gray.colors(18050, start=0, end=1)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment