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 76 77 78 79 80 81 82 83
| p1 <- ggplot() + geom_spatraster(data = slope) + scale_fill_scico( palette = "vik", na.value = NA, limits = c(-0.03, 0.03), breaks = seq(-0.03, 0.03, 0.01) ) + guides(fill = guide_colorbar(title = "Slope")) + annotate( "text", x = 75, y = Inf, label = "(a)", hjust = 1.1, vjust = 1.1, size = 5 ) + geom_point( data = stippling(pvalue), aes(x = x, y = y), color = "black", size = 0.1 ) + theme( legend.title.position = "top", legend.title = element_text(face = "italic", margin = margin(b = 20)), legend.key.width = unit(0.25, "cm"), legend.key.height = unit(0.8, "cm"), legend.ticks = element_blank(), legend.text = element_text(vjust = 0), panel.grid = element_line(color = "gray80", linetype = 2), panel.background = element_blank(), panel.border = element_rect( color = "black", fill = NA, linewidth = 0.5 ), axis.title = element_blank(), axis.ticks.length = unit(-0.1, "cm"), axis.text = element_text(color = "black"), axis.text.y = element_text(angle = 90, hjust = 0.5) )
p2 <- ggplot() + geom_spatraster(data = zvalue) + scale_fill_distiller( palette = "RdBu", na.value = NA, limits = c(-7.5, 7.5), breaks = seq(-7.5, 7.5, 2.5) ) + guides(fill = guide_colorbar(title = "Z Value")) + annotate( "text", x = 75, y = Inf, label = "(b)", hjust = 1.1, vjust = 1.1, size = 5 ) + theme( legend.title.position = "top", legend.title = element_text(face = "italic", margin = margin(b = 20)), legend.key.width = unit(0.25, "cm"), legend.key.height = unit(0.8, "cm"), legend.ticks = element_blank(), legend.text = element_text(vjust = 0), panel.grid = element_line(color = "gray80", linetype = 2), panel.background = element_blank(), panel.border = element_rect( color = "black", fill = NA, linewidth = 0.5 ), axis.title = element_blank(), axis.ticks.length = unit(-0.1, "cm"), axis.text = element_text(color = "black"), axis.text.y = element_text(angle = 90, hjust = 0.5) )
p1 + p2 + plot_layout(ncol = 1)
|