-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_default.R
78 lines (71 loc) · 3.35 KB
/
plot_default.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
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
df.selection <- VK.plot[row_selected,]
#create default plots
p1 <- ggplot(data = VK.plot, aes_string(x = VK.plot[,1], y = VK.plot[,2])) +
geom_segment(xend = VK.plot[,1], yend = 0) +
geom_point(data = df.selection, aes(x = df.selection[,1], y = df.selection[,2])) +
scale_x_continuous(limits = c(mzmin, mzmax)) +
theme_bw() +
theme(legend.position = "bottom", legend.key = element_blank()) +
xlab("\nm/z") +
ylab("Intensity\n") +
theme(panel.grid.minor = element_blank(),
panel.grid.major = element_blank(),
axis.text = element_text(size = 10),
axis.title = element_text(size = 14),
legend.title = element_blank(),
legend.text = element_text(size = 10, face = "bold"))
p2 <- ggplot(data = VK.plot, aes_string(x = VK.plot$OC, y = VK.plot[,1])) +
geom_point(shape = 16, aes(size = VK.plot$relInt, colour = VK.plot$composition), alpha = PlotSettings$transparency) +
geom_vline(xintercept = df.selection$OC) +
geom_hline(yintercept = df.selection[,1]) +
scale_color_manual(values = PlotSettings$colors) +
scale_size(range = PlotSettings$bubble_size) +
scale_y_continuous(limits = c(mzmin, mzmax)) +
scale_x_continuous(limits = c(OCmin, OCmax)) +
theme_bw() +
theme(legend.position = "none", legend.key = element_blank()) +
xlab("\nO/C") +
ylab("m/z\n") +
theme(panel.grid.minor = element_blank(),
panel.grid.major = element_blank(),
axis.text = element_text(size = 10),
axis.title = element_text(size = 14),
legend.title = element_blank(),
legend.text = element_text(size = 10, face = "bold"))
p3 <- ggplot(data = VK.plot, aes_string(x = VK.plot[,1], y = VK.plot$HC)) +
geom_point(shape = 16, aes(size = VK.plot$relInt, colour = VK.plot$composition), alpha = PlotSettings$transparency) +
geom_vline(xintercept = df.selection[,1]) +
geom_hline(yintercept = df.selection$HC) +
scale_color_manual(values = PlotSettings$colors) +
scale_size(range = PlotSettings$bubble_size) +
scale_y_continuous(limits = c(HCmin, HCmax)) +
scale_x_continuous(limits = c(mzmin, mzmax)) +
theme_bw() +
theme(legend.position = "none", legend.key = element_blank()) +
xlab("\nm/z") +
ylab("H/C\n") +
theme(panel.grid.minor = element_blank(),
panel.grid.major = element_blank(),
axis.text = element_text(size = 10),
axis.title = element_text(size = 14),
legend.title = element_blank(),
legend.text = element_text(size = 10, face = "bold"))
p4 <- ggplot(data = VK.plot, aes_string(x = VK.plot$OC, y = VK.plot$HC)) +
geom_point(shape = 16, aes(size = VK.plot$relInt, colour = VK.plot$composition), alpha = PlotSettings$transparency) +
geom_vline(xintercept = df.selection$OC) +
geom_hline(yintercept = df.selection$HC) +
scale_color_manual(values = PlotSettings$colors) +
scale_size(range = PlotSettings$bubble_size) +
scale_y_continuous(limits = c(HCmin, HCmax)) +
scale_x_continuous(limits = c(OCmin, OCmax)) +
theme_bw() +
theme(legend.position = "none", legend.key = element_blank()) +
xlab("\nO/C") +
ylab("H/C\n") +
theme(panel.grid.minor = element_blank(),
panel.grid.major = element_blank(),
axis.text = element_text(size = 10),
axis.title = element_text(size = 14),
legend.title = element_blank(),
legend.text = element_text(size = 10, face = "bold"))
grid.arrange(p1, p2, p3, p4, ncol = 2)