-
Notifications
You must be signed in to change notification settings - Fork 0
/
roary-plot.Rmd
77 lines (53 loc) · 1.31 KB
/
roary-plot.Rmd
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
---
title: "Roary.Pan-Genome_Plot"
author: "Shawn Higdon"
date: "4/7/2020"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Libraries
```{r, message=FALSE}
library(tidyverse)
library(cowplot)
```
## Reformat SVG Image
```{r panels}
# read in pan-genome pie chart
pie <- ggdraw() + draw_image("./plots/roary_pie.png")
# read in pan-genome gene diversity plot
line <- ggdraw() + draw_image("./plots/conserved_vs_total_genes.png")
# read in matrix plot
pg_mat <- ggdraw() + draw_image("./plots/matrix.png")
pie
line
pg_mat
```
```{r fonts}
library(extrafont)
#font_import() # run this once
loadfonts(device = "pdf", quiet = TRUE)
```
```{r cowplot}
theme_set(theme_cowplot(font_family = "Palatino Linotype"))
# array
Fig2_top <- plot_grid(pie,
line,
ncol = 2,
nrow = 1,
align = 'h',
labels = c("A", "B"),
label_size = 42)
Fig2_top
Fig2 <- plot_grid(Fig2_top,
pg_mat,
ncol = 1,
nrow = 2,
labels = c("", "C"),
label_size = 42,
align = 'vh')
Fig2
#Fig2
ggsave("./plots/Fig2.pdf", Fig2, width = 18, height = 20, device = cairo_pdf)
```