-
-
Save s-kganz/51793b86adbebe23bfed2afd3bf390cb to your computer and use it in GitHub Desktop.
Images that compare rainbow and grayscale color maps.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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