-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfig_2C.R
More file actions
22 lines (20 loc) · 923 Bytes
/
fig_2C.R
File metadata and controls
22 lines (20 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
source('functions.R')
strfun <- fread('data/structure_function_PA.csv')
aux <- strfun[V2 %in% c('M', 'T', 'M-T')]
p <- 'results/fig_2C.pdf'
pdf(p, 4, 4, family = 'CM Sans')
ggplot(aux, aes(x = len.v2, y = Vj.real.V1)) +
geom_segment(data = aux, colour = 'gray30', alpha=.5,
mapping = aes(x = len.v1, xend = len.v2,
y = Vj.1.V1, yend = Vj.1.V2)) +
geom_segment(data = aux, colour = 'red3', alpha=.5,
mapping = aes(x = len.v1, xend = len.v2,
y = Vj.real.V1, yend = Vj.real.V2)) +
geom_errorbar(aes(ymin = Vj.real.V2 - se.real.V2,
ymax = Vj.real.V2 + se.real.V2), width = 0.1,
colour = 'red3', alpha = .5) +
labs(x = 'Number of species', y='Vj') +
theme_bw() + ylim(0, 12) + xlim(0, 2.11) + labs(title = 'Order 2 (including pairwise)') +
theme(panel.grid = element_blank())
dev.off()
embed_fonts(p, outfile = p)