Created
September 7, 2015 23:44
-
-
Save lauratboyer/76a1b5cfea49815caf8f to your computer and use it in GitHub Desktop.
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
## custom-color-palettes.r | |
## Defining custom color palettes and loading packages for others | |
## ------------------------------------------------------- | |
## Author: Laura Tremblay-Boyer ([email protected]) | |
## Written on: August 20, 2015 | |
## Time-stamp: <2015-08-20 10:12:30 lauratb> | |
require(RColorBrewer) | |
require(colorspace) | |
cpue.colpal <- function(n=12) { | |
fb35 <- "#AC2020" #intermediate firebrick 3-4 | |
# other option going from neutral to red | |
# colorRampPalette(c("wheat3","wheat2","orange1","indianred1","firebrick2",fb35)) | |
colorRampPalette(c("royalblue3","deepskyblue1","gold","orange1","indianred1","firebrick2",fb35))(n) | |
} | |
# for residuals, want zero to be neutral colored | |
res.colpal <- function(n) { | |
colorRampPalette(c("royalblue4","royalblue2","deepskyblue","grey","ivory","ivory","grey","pink","indianred2","tomato3"))(n) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment