-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot.r
More file actions
77 lines (64 loc) · 2.5 KB
/
plot.r
File metadata and controls
77 lines (64 loc) · 2.5 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
library('ggplot2')
library('outliers')
library('dplyr')
#library('tikzDevice')
tokenizer <- read.csv("javaTokenizer.csv")
tokenizer$Service <- "Java Highlighting"
parser <- read.csv("javaJavaCCParser.csv")
parser$Service <- "Java Parser"
outline <- read.csv("javaOutliner.csv")
outline$Service <- "Java Outliner"
data <- rbind(tokenizer,parser,outline)
filelengths <- read.csv("filelengths.csv")
filelengths$file <- filelengths$filename
# filelengths.csv was generated with cloc --csv --by-file <code-dir> --report-file=filelengths.csv
data <- full_join(data, filelengths)
# data$Service <- data[data$Service == "Java Outliner",]
data <- data %>%
group_by(file,Service) %>%
mutate(isoutlier=outlier(overall,logical=TRUE)) %>%
filter(isoutlier == FALSE)
data <- data %>%
group_by(file,Service) %>%
summarise(overall=mean(overall),code=mean(code),blank=mean(blank),comment=mean(comment),productive=mean(productive))
data$lines <- data$code + data$blank + data$comment
# p <- ggplot(data, aes(y=overall/1e6, x=bytes, linetype=Service)) +
# geom_point(color="black") +
# ylab("response time (ms)") +
# xlab("file size (bytes)") +
# theme(text = element_text(size=8),
# legend.position=c(.2, .7))
# ggsave(p,filename="roundtrip.png")
# tikz(file="/Users/svenkeidel/Documents/monto/paper/roundtrip.tex", width=3.2, height=2.5)
# print(p)
# dev.off()
p <- ggplot(data, aes(y=overall/1e6, x=lines, linetype=Service)) +
geom_smooth(color="black") +
ylab("response time (ms)") +
xlab("lines of code") +
theme(text = element_text(size=8),
legend.position=c(.2, .7))
ggsave(p,filename="roundtriploc.png")
#tikz(file="/Users/svenkeidel/Documents/monto/paper/roundtriploc.tex", width=3.2, height=2.5)
print(p)
dev.off()
# p <- ggplot(data, aes(y=(overall-productive)/1e6, x=bytes, linetype=Service)) +
# geom_point(color="black") +
# ylab("overhead (ms)") +
# xlab("file size (bytes)") +
# theme(text = element_text(size=8),
# legend.position=c(.2, .7))
# ggsave(p,filename="overhead.png")
# tikz(file="/Users/svenkeidel/Documents/monto/paper/overhead.tex", width=3.2, height=2.5)
# print(p)
# dev.off()
# p <- ggplot(data, aes(y=(overall-productive)/1e6, x=lines, linetype=Service)) +
# geom_smooth(color="black") +
# ylab("overhead (ms)") +
# xlab("lines of code") +
# theme(text = element_text(size=8),
# legend.position=c(.2, .7))
# ggsave(p,filename="overheadloc.png")
# tikz(file="/Users/svenkeidel/Documents/monto/paper/overheadloc.tex", width=3.2, height=2.5)
# print(p)
# dev.off()