library(RColorBrewer) library(patchwork)
colorRampPalette(rev(brewer.pal(n = 7,name = "RdYlBu"))) -> cc
P1 <- ggplot(world, aes( long, lat)) +geom_bin2d(binwidth = c(0.1, 0.1))+ theme_map() +ggtitle('0.1 0.1')+ theme(plot.title = element_text(hjust=0.5,size=20))+ scale_fill_gradientn(colors=cc(100)) P2 <- ggplot(world, aes( long, lat)) +geom_bin2d(binwidth = c(0.1, 10))+ theme_map() +ggtitle('0.1 10')+ theme(plot.title = element_text(hjust=0.5,size=20))+ scale_fill_gradientn(colors=cc(100)) P3 <- ggplot(world, aes( long, lat)) +geom_bin2d(binwidth = c(10, 0.1))+ theme_map() +ggtitle('10 0.1')+ theme(plot.title = element_text(hjust=0.5,size=20))+ scale_fill_gradientn(colors=cc(100)) P4 <- ggplot(world, aes( long, lat)) +geom_bin2d(binwidth = c(10, 10))+ theme_map() +ggtitle('10 10')+ theme(plot.title = element_text(hjust=0.5,size=20))+ scale_fill_gradientn(colors=cc(100))
(P1|P2)/(P4|P3)
|