Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make palette for herd status diplayed on maps #10

Open
PetterHopp opened this issue Jul 27, 2021 · 1 comment
Open

Make palette for herd status diplayed on maps #10

PetterHopp opened this issue Jul 27, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@PetterHopp
Copy link
Member

The colours in the graphical profile don't cover this.
The colours should be established in accord with the discussion in the Teams group.
We need to find a good name for the palette(s).

@PetterHopp PetterHopp added the enhancement New feature or request label Jul 27, 2021
@JohanAkerstedt
Copy link

JohanAkerstedt commented Jul 30, 2021

Dear Petter,
I supply code that will display colours of several colourblidsafe pallettes.
This is how far I've got. Maybe it is possible to adjust some colours to better fit in to the NVI colour standard?
I used Tol_light a lot, but maybe it is a bit pale?

To run i just copy the code to a new document in Rstudio (it wasn't possible to copy the whole file to GitHub)

Johan

Display_color_scales.R :

Taken mostly from https://tradeblotter.wordpress.com/2013/02/28/the-paul-tol-21-color-salute/

Function for plotting colors side-by-side

pal <- function(col, border = "light gray", ...){
n <- length(col)
title <- deparse(substitute(col))
plot(0, 0, type="n", xlim = c(0, 1), ylim = c(0, 1),
axes = FALSE, main=title,xlab = "", ylab = "", ...)
rect(0:(n-1)/n, 0, 1:n/n, 1, col = col, border = border)
}

Function for plotting colors as pie

palpie <- function(col)
{
par(mar=c(1,1,1,1))
ones <- rep(1, length=length(col))
names(ones) <- col

title <- deparse(substitute(col))

pie(ones, col=col, cex=1, main = title)
par(mar=c(5.1, 4.1, 4.1, 2.1))
}

########## DEFINE Color palettes #########

#From Paul Tol: https://personal.sron.nl/~pault/
Tol_bright <- c('#EE6677', '#228833', '#4477AA', '#CCBB44', '#66CCEE', '#AA3377', '#BBBBBB')

Tol_muted <- c('#88CCEE', '#44AA99', '#117733', '#332288', '#DDCC77', '#999933','#CC6677', '#882255', '#AA4499', '#DDDDDD')

Tol_light <- c('#BBCC33', '#AAAA00', '#77AADD', '#EE8866', '#EEDD88', '#FFAABB', '#99DDFF', '#44BB99', '#DDDDDD')

#From Color Universal Design (CUD): https://jfly.uni-koeln.de/color/
Okabe_Ito <- c("#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7", "#000000")

From Katie

Katie <- c("#D55E00","#E69F00","#F0E442","#56B4E9","#009E73","black","grey")

Others

ECDC <- c("#65B32E","#7CBDC4","#C0D236","#3E5B84","#008C75","#82428D","#E8683F","#B81A5D")

colorBlindBlack8 <- c("#000000", "#E69F00", "#56B4E9", "#009E73",
"#F0E442", "#0072B2", "#D55E00", "#CC79A7")
colorBlindGrey8 <- c("#999999", "#E69F00", "#56B4E9", "#009E73",
"#F0E442", "#0072B2", "#D55E00", "#CC79A7")
safe_colorblind_palette <- c("#88CCEE", "#CC6677", "#DDCC77", "#117733", "#332288", "#AA4499",
"#44AA99", "#999933", "#882255", "#661100", "#6699CC", "#888888")

########################## SHOW as multiple strips ###################
par(mfrow=c(3,3))

pal(Okabe_Ito)
pal(Tol_bright)
pal(Tol_muted)
pal(Tol_light)
pal(Katie)
pal(ECDC)
pal(colorBlindBlack8)
pal(colorBlindGrey8)
pal(safe_colorblind_palette )

########################## SHOW as multiple PIE Charts ###################
par(mfrow=c(3,3))

palpie(Okabe_Ito)
palpie(Tol_bright)
palpie(Tol_muted)
palpie(Tol_light)
palpie(Katie)
palpie(ECDC)
palpie(colorBlindBlack8)
palpie(colorBlindGrey8)
palpie(safe_colorblind_palette )

########################## SHOW as single PIE Chart ###################
par(mfrow=c(1,1))

palpie(Okabe_Ito)
palpie(Tol_bright)
palpie(Tol_muted)
palpie(Tol_light)
palpie(Katie)
palpie(ECDC)
palpie(colorBlindBlack8)
palpie(colorBlindGrey8)
palpie(safe_colorblind_palette )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants