Last active
December 12, 2015 08:49
-
-
Save jeffreyiacono/4747104 to your computer and use it in GitHub Desktop.
fun with R's colorRampPalette + plot
This file contains hidden or 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
pal <- colorRampPalette(c("red", "blue")) | |
plot(rnorm(1000), seq(1, 1000, by = 1) | |
, col = pal(1000) | |
, xlab = "x" | |
, ylab = "y" | |
, main = "Fun with rnorm + colorRampPalette") | |
# => view Plot 1 | |
pal <- colorRampPalette(c("red", "yellow", "blue")) | |
plot(rnorm(1000), seq(1, 1000, by = 1) | |
, col = pal(1000) | |
, xlab = "x" | |
, ylab = "y" | |
, main = "Fun with rnorm + colorRampPalette (double rainbow)") | |
# => view Plot 2 | |
pal <- colorRampPalette(c("dark blue", "light blue")) | |
plot(rnorm(1000), seq(1, 1000, by = 1) | |
, col = pal(1000) | |
, xlab = "x" | |
, ylab = "y" | |
, main = "Fun with rnorm + colorRampPalette (the blues)") | |
# => view Plot 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment