-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_study_area.R
82 lines (77 loc) · 1.92 KB
/
plot_study_area.R
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
library(rnaturalearth)
library(rnaturalearthdata)
library(ggplot2)
library(rworldmap)
library(scales)
library(sf)
library(mapdata)
library(maptools)
library(ggthemes)
library(ggspatial)
data(wrld_simpl)
antarctica <- wrld_simpl[wrld_simpl$NAME == "Antarctica", ]
pr <-
"+proj=laea +lat_0=-90 +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0"
antarctica.laea <- spTransform(antarctica, CRS(pr))
antarctica.laea <- st_as_sf(antarctica.laea)
research_area <-
data.frame(
maxlat = -81.762,
minlat = -82.586,
maxlong = 57.725,
minlong = 51.670
)
study_side_point <-
transform(
research_area,
laby = (maxlat + minlat) / 2,
labx = (maxlong + minlong) / 2
)
# gene world map
antarctica_plot <- ggplot() +
geom_sf(data = antarctica.laea, color = '#37363B', lwd = 1) +
geom_sf(data = antarctica.laea, fill = '#FEFEFE', lwd = 0) +
geom_rect(
aes(
ymin = -82.586,
ymax = -81.762,
xmin = 51.670,
xmax = 57.725
),
color = "#ff6361",
fill = 'transparent',
label = 'Research area'
) +
geom_point(
aes(x = 0,
y = -90),
color = "#ff6361",
shape = 16,
size = 3,
label = 'South pole'
) +
geom_point(
aes(x = 65.78333,
y = -85.83333),
color = "#ff6361",
shape = 18,
size = 3,
label = 'Southern pole of inaccessibility'
) +
labs(x = "Longitude", y = "Latitude") +
annotation_scale(location = "bl", width_hint = 0.5) +
annotation_north_arrow(
location = "bl",
which_north = "true",
pad_x = unit(0.03, "in"),
pad_y = unit(0.3, "in"),
style = north_arrow_fancy_orienteering
) +
coord_sf(default_crs = sf::st_crs(4326)) +
ggtitle("Position of the research area at Antarctic") +
theme_fivethirtyeight()
antarctica_plot + theme(
plot.background = element_rect(fill = "transparent"),
panel.background = element_rect(fill = "#62BDEC"),
panel.grid.major=element_line(colour="#37363B", size=0.25)
)