-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNetmigration_vs_vulnerability_Figure1E.R
35 lines (29 loc) · 1.35 KB
/
Netmigration_vs_vulnerability_Figure1E.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
library(readxl)
library(ggplot2)
library(lubridate)
library(tidyverse)
library(dplyr)
library(ggrepel)
db <- read_csv('data/migration_vulnerability.csv')
options(scipen=999)
db$Entity
disease_burden <- ggplot(db, aes(x=LogNetM, y=Vulnerability,size = Population, color=Continent, label = Entity))+
theme_classic()+
geom_point(alpha = .6)+
theme(axis.text.x = element_text(color="black", size=10))+
theme(axis.title.y = element_text(color="black", size=10))+
theme(axis.text.y = element_text(color="black", size=10))+
scale_color_manual(values=c('#1b4332', '#1bb28c','#bb8557', '#fed45b', '#007ea7', '#e86a58', 'grey'), name='')+
xlab('Net Migration (log10)')+
ylab('Vulnerability')+
ylim(0.2, 0.7)+
xlim(-8,8)+
scale_size(range=c(0,8), limits = c(10000,1450000000), breaks=c(10000, 50000000, 75000000,1000000000, 1450000000), labels=c('10,000', '50 million', '75 million','1 billion', '1.45 billion'))+
geom_text_repel(data=db, mapping = aes(x=db$LogNetM, y=db$Vulnerability,label = db$Entity), size =2.5, max.overlaps = Inf)+
coord_cartesian(clip = "off") +
theme(legend.title = element_blank())+
theme(legend.position = 'right')+
theme(legend.text = element_text(color="black", size=10))+
guides(colour = guide_legend(override.aes = list(size = 3, alpha = 1)))+
scale_x_continuous(breaks = c(-8,-6, -4, -2, 0, 2, 4, 6, 8))
disease_burden