-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_dfec_volume_fraction.R
executable file
·44 lines (38 loc) · 1.21 KB
/
plot_dfec_volume_fraction.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
#!/usr/bin/env Rscript
library(reshape2)
library(data.table)
library(jsonlite)
library(argparse)
library(ggplot2)
theme_set(theme_bw(base_size=24) + theme(
legend.key.size=unit(1, 'lines'),
text=element_text(face='plain', family='CM Roman'),
legend.title=element_text(face='plain'),
axis.line=element_line(color='black'),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
legend.key = element_blank(),
#legend.position = "top",
#legend.direction = "vertical",
panel.border = element_blank()
))
parser <- ArgumentParser(description='plot fit prediction')
parser$add_argument('summary', nargs=1)
parser$add_argument('output', nargs=1)
args <- parser$parse_args()
summary = melt(fread(args$summary), id.vars="volume_fraction")
print(summary)
plot = ggplot(summary, aes(colour=variable)) +
geom_line(aes(x=volume_fraction, y=value, group=variable), size=1) +
labs(
x="volume fraction",
y="dark field extinction coefficient [1/m]"
)
width = 14
factor = 0.8
height = width * factor
X11(width=width, height=height)
print(plot)
warnings()
ggsave(args$output, plot, width=width, height=height, dpi=600)
invisible(readLines(con="stdin", 1))