@@ -19,12 +19,18 @@ volcano_sf <-
19
19
NA_character_ , last_eruption_year ),
20
20
last_eruption_year = as.numeric(last_eruption_year )) %> %
21
21
st_as_sf(coords = c(" longitude" , " latitude" )) %> %
22
- st_set_crs(4326 )
22
+ st_set_crs(4326 ) %> %
23
+ st_transform(" +proj=eqearth +wktext" )
24
+
25
+ world_proj <-
26
+ world %> %
27
+ st_as_sf() %> %
28
+ st_transform(" +proj=eqearth +wktext" )
23
29
24
30
world_hex <-
25
- world %> %
31
+ world_proj %> %
26
32
st_make_grid(what = " polygons" , square = FALSE ,
27
- n = c(400 , 200 )) %> %
33
+ n = c(400 , 200 )) %> % # soooo long
28
34
st_sf() %> %
29
35
mutate(id_hex = 1 : n()) %> %
30
36
select(id_hex , geometry )
@@ -46,7 +52,8 @@ world_point <-
46
52
mutate(volcano = case_when(is.na(recent_eruption ) ~ " no" ,
47
53
recent_eruption ~ " recent" ,
48
54
TRUE ~ " old" )) %> %
49
- st_centroid()
55
+ st_centroid() %> %
56
+ st_transform(" +proj=eqearth +wktext +lon_0=-105" )
50
57
51
58
52
59
# ### Plots ####
@@ -56,7 +63,7 @@ font <- "Volcanic Dungeon"
56
63
ggplot(world_point ) +
57
64
geom_sf(aes(color = volcano ), size = 0.01 ) +
58
65
scale_color_manual(values = c(" no" = " #4C453A" , " recent" = " #EC5E29" , " old" = " #D6FC79" )) +
59
- annotate(geom = " text" , x = 190 , y = - 100 , family = font , size = 3 ,
66
+ annotate(geom = " text" , x = 17000000 , y = - 9500000 , family = font , size = 3 ,
60
67
color = " #E3E2CE" , hjust = 1.06 , lineheight = 1.7 ,
61
68
label = " Source: The Smithsonian Institution\n @_abichat for #TidyTuesday " ) +
62
69
labs(title = " Volcanoes around the world" ,
@@ -67,7 +74,7 @@ ggplot(world_point) +
67
74
plot.title = element_markdown(color = " #E3E2CE" , hjust = 0.5 , size = 20 , family = font ),
68
75
plot.subtitle = element_markdown(color = " #E3E2CE" , hjust = 0.5 , size = 12 , family = font ),
69
76
panel.grid = element_blank(),
70
- plot.margin = margin(10 , - 45 , 5 , - 25 ),
77
+ plot.margin = margin(10 , - 25 , 5 , - 25 ),
71
78
plot.background = element_rect(fill = " black" ))
72
79
73
- ggsave(" plots/plot_2020-05-12.png" , width = 29 , height = 18.7 , units = " cm" , dpi = " retina" )
80
+ ggsave(" plots/plot_2020-05-12.png" , width = 29 , height = 18.98 , units = " cm" , dpi = " retina" )
0 commit comments