-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpanel-plots.R
More file actions
111 lines (94 loc) · 4.91 KB
/
panel-plots.R
File metadata and controls
111 lines (94 loc) · 4.91 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# panel-plots.R is part of Food INdustry CoViD Control Tool
# (FInd CoV Control), version 3.0.
# Copyright (C) 2020-2024 Cornell University.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
library(png)
library(ggplot2)
library(grid)
library(cowplot)
dir.create('figures-after-additional-fixes/')
filenames = c(
'H_R_V2-check/stealing-issue-resolved-ABM-1000xfacility-shared-vaccinated_TRUE-recovered_TRUE_Symptomatic-incidence_3.0.png',
'H_R_V2-check/stealing-issue-resolved-ABM-1000xfacility-shared-vaccinated_TRUE-recovered_TRUE_Symptomatic_3.0.png',
'H_R_V2-check/stealing-issue-resolved-ABM-1000xfacility-shared-vaccinated_TRUE-recovered_TRUE_Symptomatic-Fraction-Non-Zero_3.0.png',
'H_R_V2-check/stealing-issue-resolved-ABM-1000xfacility-shared-vaccinated_TRUE-recovered_TRUE_Total-Symptomatic-Infections-violin_3.0.png',
'H_R_V2-check/stealing-issue-resolved-ABM-1000xfacility-shared-vaccinated_TRUE-recovered_TRUE_non-zero-pairwise-differences-Total-Symptomatic-Infections-violin_3.0.png',
'H_R_V2-check/stealing-issue-resolved-ABM-1000xfacility-shared-vaccinated_TRUE-recovered_TRUE_non-zero-pairwise-percent-differences-Total-Symptomatic-Infections-violin--cut-and-trimmed_3.0.png'
)
png('figures-after-additional-fixes/figure-2-rearranged-stealing-issue-resolved-ABM-1000x--cut-and-trimmed.png', width = 2000, height = 3000)
l = NULL
for(filename in filenames) {
this_image = readPNG(filename)
this_plot = ggplot() + annotation_custom(
grid::rasterGrob(
this_image,
width = unit(1, 'npc'),
height = unit(1, 'npc')
)
)
l = c(l, list(this_plot))
}
print(plot_grid(plotlist = l, nrow = 3, byrow = FALSE))
dev.off()
#stop('Got the first plot!')
filenames = c(
'H_R_V2-check/stealing-issue-resolved-ABM-1000xfacility-shared-vaccinated_TRUE-recovered_TRUE_Unavailable-production_3.0.png',
'H_R_V2-check/stealing-issue-resolved-ABM-1000xfacility-shared-vaccinated_TRUE-recovered_TRUE_Total-Unavailable-production-violin_3.0.png',
'H_R_V2-check/stealing-issue-resolved-ABM-1000xfacility-shared-vaccinated_TRUE-recovered_TRUE_Unavailable-production-Fraction-Non-Zero_3.0.png',
'H_R_V2-check/stealing-issue-resolved-ABM-1000xfacility-shared-vaccinated_TRUE-recovered_TRUE_zero-pairwise-differences-Total-Unavailable-production-violin_3.0.png',
'H_R_V2-check/stealing-issue-resolved-ABM-1000xfacility-shared-vaccinated_TRUE-recovered_TRUE_non-zero-pairwise-differences-Total-Unavailable-production-violin_3.0.png',
'H_R_V2-check/stealing-issue-resolved-ABM-1000xfacility-shared-vaccinated_TRUE-recovered_TRUE_non-zero-pairwise-percent-differences-Total-Unavailable-production-violin_3.0.png'
)
png('figures-after-additional-fixes/figure-3-rearranged-stealing-issue-resolved-ABM-1000x.png', width = 2000, height = 3000)
l = NULL
for(filename in filenames) {
if(is.na(filename)) {
this_plot = ggplot()
} else {
this_image = readPNG(filename)
this_plot = ggplot() + annotation_custom(
grid::rasterGrob(
this_image,
width = unit(1, 'npc'),
height = unit(1, 'npc')
)
)
l = c(l, list(this_plot))
}
}
print(plot_grid(plotlist = l, nrow = 3, byrow = FALSE))
dev.off()
filenames = c(
'H_R_V2-check/stealing-issue-resolved-ABM-1000xfacility-shared-vaccinated_TRUE-recovered_TRUE_Total-Intervention-Expenses-violin_3.0.png',
'H_R_V2-check/stealing-issue-resolved-ABM-1000xfacility-shared-vaccinated_TRUE-recovered_TRUE_Total-Production-Loss-violin_3.0.png',
'H_R_V2-check/stealing-issue-resolved-ABM-1000xfacility-shared-vaccinated_TRUE-recovered_TRUE_Total-Cost-violin_3.0.png',
'H_R_V2-check/stealing-issue-resolved-ABM-1000xfacility-shared-vaccinated_TRUE-recovered_TRUE_v4b-Fraction-Short-production-violin_3.0.png'
)
png('figures-after-additional-fixes/figure-4-rearranged-stealing-issue-resolved-ABM-1000x.png', width = 2000, height = 2000)
l = NULL
for(filename in filenames) {
this_image = readPNG(filename)
this_plot = ggplot() + annotation_custom(
grid::rasterGrob(
this_image,
width = unit(1, 'npc'),
height = unit(1, 'npc')
)
)
l = c(l, list(this_plot))
}
print(plot_grid(plotlist = l, nrow = 2, byrow = FALSE))#2))
dev.off()