setwd("~/ownCloud/Stages/2020_manuscrits_Dartois_etal/ms2_tufa/map/") read.table('sites.txt', sep='\t', header=T) -> sites library(ggplot2) ggplot() + geom_sf(data = shp) + coord_sf(xlim = c(-5, 1), ylim = c(45,49), expand = FALSE) ggplot(data = pol) + geom_sf() + coord_sf(xlim = c(-102.15, -74.12), ylim = c(7.65, 33.97), expand = FALSE) install.packages(c("cowplot", "googleway", "ggplot2", "ggrepel", "ggspatial", "libwgeom", "sf", "rnaturalearth", "rnaturalearthdata")) install.packages('ggpubr') install_github("ropensci/rnaturalearthhires") library("rnaturalearth") library("rnaturalearthdata") library("rnaturalearthhires") library('devtools') library("ggplot2") library("ggspatial") library("sf") library("ggpubr") world <- ne_countries(scale = "large", returnclass = "sf") class(world) theme_set(theme_bw()) ggplot(data = world) + geom_sf() + annotation_scale(location = "bl", width_hint = 0.5) + annotation_north_arrow(location = "bl", which_north = "true", pad_x = unit(0.75, "in"), pad_y = unit(0.5, "in"), style = north_arrow_fancy_orienteering) + geom_text(data= sites,aes(x=x, y=y, label=site), nudge_x = 0.1, nudge_y = 0.1, color = "black", check_overlap = FALSE) + geom_point(data= sites,aes(x=x, y=y)) + coord_sf(xlim = c(-5,0), ylim = c(46,49), expand = FALSE) + xlab("") + # pour le titre de l'axe des x ylab("") # pour le titre de l'axe des y world <- ne_countries(scale = "large", returnclass = "sf") zm = ggplot(data = world) + geom_sf() + annotation_scale(location = "bl", width_hint = 0.5) + annotation_north_arrow(location = "bl", which_north = "true", pad_x = unit(0.75, "in"), pad_y = unit(0.5, "in"), style = north_arrow_fancy_orienteering) + geom_text(data= sites,aes(x=x, y=y, label=site), nudge_x = 0.1, nudge_y = 0.1, color = "black", check_overlap = FALSE) + geom_point(data= sites,aes(x=x, y=y)) + coord_sf(xlim = c(-5,0), ylim = c(46,49), expand = FALSE) + xlab("") + # pour le titre de l'axe des x ylab("") # pour le titre de l'axe des y world_map <- map_data("world") wrld = ggplot(world_map, aes(x = long, y = lat, group = group)) + # geom_rect(mapping=aes(xmin=-5, xmax=0, ymin=46, ymax=49), color="black", alpha=0.5) + geom_polygon(fill="lightgray", colour = "white") + coord_sf(xlim = c(-7,9), ylim = c(34,61), expand = FALSE) + geom_rect(mapping=aes(xmin=-5, xmax=0, ymin=46, ymax=49), fill='NA', size=0.5, color='black') figure <- ggarrange(wrld, zm, # labels = c("A", "B"), ncol = 2, nrow = 1, widths=c(1,2)) figure