-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample_mapsColorPalette.R
More file actions
75 lines (56 loc) · 2.62 KB
/
Copy pathExample_mapsColorPalette.R
File metadata and controls
75 lines (56 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
##Example
jet.colors <- colorRampPalette(c("#00007F", "blue", "#007FFF", "cyan", "#7FFF7F", "yellow", "#FF7F00", "red", "#7F0000"))
green2yellow2red<- colorRampPalette(c("#7FFF7F", "yellow", "red"))
sunflower<-colorRampPalette(c("#b44601",
"#cf722a",
"#fecb01",
"#bdc901",
"#8aab00"))
greenhill<-colorRampPalette(c("#3e5586",
"#5da8a0",
"#cbe552",
"#95b54c",
"#607123"))
jajakflwr<-colorRampPalette(c("#3a0853",
"#930784",
"#ba07bb",
"#cccef7",
"#917ed9"))
honeyLavender<-colorRampPalette( c("#fed337",
"#da9101",
"#666103",
"#7d488e",
"#2a1227")
)
#test
filled.contour(volcano, color = honeyLavender, asp = 1, nlevels=100)
ex.1<-df.minT.FL.Jan.shapef%>%filter(Month=="Jan")%>%ggplot(.,aes(long,lat))+
geom_polygon(aes(group=group,fill=Avg_Max_T_C_30yr), color="white")+theme_bw()+
#scale_fill_gradientn("Avg_Min_T_C_30yr", colors=c('blue', 'yellow', 'red'))#+
#scale_fill_gradientn(colours=rev(brewer.pal(9,"Blues")))
#geom_label_repel(data=cnames,aes(x=long,y=lat,label=subregion))+
scale_fill_gradientn(colors=honeyLavender(20))+
theme(legend.position = c(0.25,0.5))+ggtitle("jet.colors")
#same result
ex.2<-df.minT.FL.Jan.shapef%>%filter(Month=="Aug")%>%ggplot(.,aes(long,lat))+
geom_polygon(aes(group=group,fill=Avg_Max_T_C_30yr), color="white")+theme_bw()+
#scale_fill_gradientn("Avg_Min_T_C_30yr", colors=c('blue', 'yellow', 'red'))#+
#scale_fill_gradientn(colours=rev(brewer.pal(9,"Blues")))
#geom_label_repel(data=cnames,aes(x=long,y=lat,label=subregion))+
scale_fill_gradientn(colors=matlab.like(400)+
theme(legend.position = c(0.25,0.5))+ggtitle("colorRamps::matlab.like1")
ex.3<-df.minT.FL.Jan.shapef%>%filter(Month=="Aug")%>%ggplot(.,aes(long,lat))+
geom_polygon(aes(group=group,fill=Avg_Max_T_C_30yr), color="white")+theme_bw()+
#scale_fill_gradientn("Avg_Min_T_C_30yr", colors=c('blue', 'yellow', 'red'))#+
#scale_fill_gradientn(colours=rev(brewer.pal(9,"Blues")))
#geom_label_repel(data=cnames,aes(x=long,y=lat,label=subregion))+
scale_fill_gradientn(colors=matlab.like2(400))+
theme(legend.position = c(0.25,0.5))+ggtitle("colorRamps::matlab.like2")
ex.4<-df.minT.FL.Jan.shapef%>%filter(Month=="Aug")%>%ggplot(.,aes(long,lat))+
geom_polygon(aes(group=group,fill=Avg_Max_T_C_30yr), color="white")+theme_bw()+
#scale_fill_gradientn("Avg_Min_T_C_30yr", colors=c('blue', 'yellow', 'red'))#+
#scale_fill_gradientn(colours=rev(brewer.pal(9,"Blues")))
#geom_label_repel(data=cnames,aes(x=long,y=lat,label=subregion))+
scale_fill_gradientn(colors=colorRamps::blue2red(400))+
theme(legend.position = c(0.25,0.5))+ggtitle("colorRamps::blue2red()")
cowplot::plot_grid(ex.1,ex.2,ex.3,ex.4)