-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfig_3D.R
More file actions
23 lines (22 loc) · 980 Bytes
/
fig_3D.R
File metadata and controls
23 lines (22 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
source('functions.R')
d <- fread('data/three_sp_consortia.csv')
p <- 'results/fig_3D.pdf'
pdf(p, 5, 4, family = 'CM Sans')
ggplot(d, aes(eps.2, d.epsilon.ABC, colour = (bg=='P' | pair %like% 'P'))) +
geom_errorbar(aes(ymin=d.epsilon.ABC - d.epsilon.ABC.se,
ymax=d.epsilon.ABC + d.epsilon.ABC.se),
size=.5, width = .3, colour = 'gray') +
geom_errorbarh(aes(xmin=eps.2 - eps.2.se,
xmax=eps.2 + eps.2.se),
size=.5, width = .3, colour = 'gray') +
geom_hline(yintercept = 0, col='gray', linetype = 2) +
geom_vline(xintercept = 0, col='gray', linetype = 2) +
geom_point(size = 3) +
scale_colour_manual(values = c('skyblue3', 'chocolate2')) +
theme_bw() + labs(title = 'Triads',
y = 'Higher order epistasis' ,
x = expression(paste(Sigma, epsilon[ij]^0)),
colour = 'P. polymyxa \nin triad') +
theme(panel.grid = element_blank())
dev.off()
embed_fonts(p, outfile = p)