plotcolors<-function(ncolors,pointsize){
tibble(x=seq(1,ncolors,1), y = rep(1,ncolors), colnum = paste("color",x,sep = " ")) %>%
ggplot(aes(x,y, fill=as.factor(x)), label = text) + geom_point(size= pointsize, pch=21, color = "white") +
geom_text(aes(label = colnum, color = as.factor(x)), vjust= -0.25, hjust=-0.85, angle=75, fontface='bold',size=5) +
theme(legend.position = "none") +
theme(panel.grid = element_blank(), panel.border = element_blank(), axis.ticks = element_blank(),
axis.text = element_blank(), axis.title = element_blank())
}
gmri_cols<-c("#00608a","#abb400","#e2e2e2")
gmri_gradient<-colorRampPalette(c("#00608a","#abb400"))
gmri_blues<-colorRampPalette(c("white","#5d96af","#00608a","#00293c"))
gmri_greens<-colorRampPalette(c("white","#d1d673","#abb400","#73763e"))
gmri_qualitative<-c("#003A54","#00608A","#5D96AF","#6F7E4B","#97AA5C","#A8B212","#767676","#A7A7A7","#E2E2E2")
gmri_qual_extended<-c("#003A54","#00608A","#5D96AF","#3F4B24","#6F7E4B","#97AA5C","#A8B212","#AF9700","#EACA00","#FFE961","#BB3F0E", "#EA4F12","#F4916B","#00736D", "#55A29E","#A0CDCB","#767676","#A7A7A7","#E2E2E2")
gom_qualitative<-c("#1A3643","#405F74","#C2C1BB","#92938C","#53594E","#8A9565","#6F7E4B")
atl_fisheries<-tribble(
~statename, ~color,
"Maine", "#596E4E",
"New Hampshire", "#B05643",
"Massachusetts", "#25356F",
"Rhode Island", "#CB9D00",
"Connecticut", "#961E1D",
"New York", "#B3875A",
"New Jersey", "#FFD380",
"Delaware", "#76A1A0",
"Virginia", "#97C8F0",
"Maryland", "#58111D",
"North Carolina", "#A2A3A5"
)
fishery_palette<-c(atl_fisheries$color)
Color palettes based on GMRI aesthetics
gmri_gradient<-colorRampPalette(c("#00608a","#abb400"))
plotcolors(10,16) + scale_fill_manual(values = gmri_gradient(10)) + scale_color_manual(values = gmri_gradient(10))
gmri_blues<-colorRampPalette(c("white","#5d96af","#00608a","#00293c"))
plotcolors(20,12) + scale_fill_manual(values = gmri_blues(20)) + scale_color_manual(values = gmri_blues(20))
gmri_greens<-colorRampPalette(c("white","#d1d673","#abb400","#73763e"))
plotcolors(20,12) + scale_fill_manual(values = gmri_greens(20)) + scale_color_manual(values = gmri_greens(20))
gmri_qualitative<-c("#003A54","#00608A","#5D96AF","#6F7E4B","#97AA5C","#A8B212","#767676","#A7A7A7","#E2E2E2")
plotcolors(9,18) + scale_fill_manual(values = gmri_qualitative) + scale_color_manual(values = gmri_qualitative)
gmri_qual_extended<-c("#003A54","#00608A","#5D96AF","#3F4B24","#6F7E4B","#97AA5C","#A8B212","#AF9700","#EACA00","#FFE961","#BB3F0E", "#EA4F12","#F4916B","#00736D", "#55A29E","#A0CDCB","#767676","#A7A7A7","#E2E2E2")
plotcolors(19,13) + scale_fill_manual(values = gmri_qual_extended) + scale_color_manual(values = gmri_qual_extended)
gom_qualitative<-c("#1A3643","#405F74","#C2C1BB","#92938C","#53594E","#8A9565","#6F7E4B")
plotcolors(7,19) + scale_fill_manual(values = gom_qualitative) + scale_color_manual(values = gom_qualitative)
fishery_palette<-c(atl_fisheries$color)
tibble(x=seq(1,11,1), y = rep(1,11), colnum = paste("color",x,sep = " ")) %>%
bind_cols(atl_fisheries) %>%
ggplot(aes(x,y, fill=as.factor(x)), label = statename) + geom_point(size= 12, pch=21, color = "white") +
geom_text(aes(label = statename, color = as.factor(x)), vjust= 0.25, hjust=-0.3, angle=90, fontface='bold',size=5) +
theme(legend.position = "none", panel.grid = element_blank(), panel.border = element_blank(),
axis.ticks = element_blank(), axis.text = element_blank(), axis.title = element_blank()) +
scale_fill_manual(values = fishery_palette) + scale_color_manual(values = fishery_palette)