-
Notifications
You must be signed in to change notification settings - Fork 0
/
multiLine.R
35 lines (28 loc) · 897 Bytes
/
multiLine.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
library(Cairo)
CairoFonts(regular = "WenQuanYi Micro Hei",
bold = "WenQuanYi Micro Hei")
argv <- commandArgs(TRUE)
# logdata working dir
# setwd("~/workspace/R/logdata")
setwd(as.character(argv[1]))
# time_data_table
# source_time_data_table_filename <- "kernel_time_data_table.txt"
source_time_data_table_filename <- as.character(argv[2])
data <- read.table(source_time_data_table_filename, header=TRUE)
y <- data[, 2]
x <- data[, 1]
c=max(data[, -1])
maxkernel=max(x)
CairoSVG(paste(source_time_data_table_filename, ".svg", sep=""))
plot(x, type='n', xlim=c(0, maxkernel), ylim=c(0, c*1.2), main='用例时间曲线', xlab='核数', ylab='时间', xaxt='n', yaxt='n')
d=round(c, digits=0)
axis(side=2, at=seq(0,d*1.1,signif(d/10,digits=1)))
for (i in 1:length(x))
{
axis(side=1, at=seq(x[i],x[i]+1,2))
}
for (i in 2:ncol(data))
{
lines(data[,1],data[,i],col=i)
}
dev.off()