plotting: respect types

This commit is contained in:
Alwin Berger 2023-02-22 09:02:14 +01:00
parent 7420aabeeb
commit 41586dd8b1

View File

@ -2,7 +2,7 @@ library("mosaic")
args = commandArgs(trailingOnly=TRUE) args = commandArgs(trailingOnly=TRUE)
#myolors=c("#339933","#0066ff","#993300") # grün, balu, rot #myolors=c("#339933","#0066ff","#993300") # grün, balu, rot
myolors=c("dark green","dark blue","dark red", "yellow") # grün, balu, rot myolors=c("green","blue","red", "yellow", "pink", "black") # grün, balu, rot
if (length(args)==0) { if (length(args)==0) {
runtype="timedump" runtype="timedump"
@ -138,12 +138,14 @@ frame2plot <- function(maxlines,colors=NULL,draw_extreme=TRUE,doint=FALSE,over_n
all_maxlines = c() all_maxlines = c()
for (bn in BASENAMES) { for (bn in BASENAMES) {
runtypefiles <- list.files(file.path(BENCHDIR,bn),pattern="\\.[0-9]$",full.names = TRUE) runtypefiles <- list.files(file.path(BENCHDIR,bn),pattern=sprintf("%s.[0-9]$",target),full.names = TRUE)
runtypetables = lapply(runtypefiles, function(x) read.table(x, quote="\"", comment.char="", col.names=c(bn))) if (length(runtypefiles) > 0) {
runtypetables = trim_data(runtypetables) runtypetables = lapply(runtypefiles, function(x) read.table(x, quote="\"", comment.char="", col.names=c(bn)))
list_of_maxlines = data2maxlines(runtypetables) runtypetables = trim_data(runtypetables)
mean_maxline<-Reduce(function(a,b) a+b,list_of_maxlines,0)/length(runtypetables) list_of_maxlines = data2maxlines(runtypetables)
all_maxlines=append(all_maxlines,mean_maxline) mean_maxline<-Reduce(function(a,b) a+b,list_of_maxlines,0)/length(runtypetables)
all_maxlines=append(all_maxlines,mean_maxline)
}
} }
min_length <- min(sapply(all_maxlines, length)) min_length <- min(sapply(all_maxlines, length))
all_maxlines=lapply(all_maxlines, function(v) v[1:min_length]) all_maxlines=lapply(all_maxlines, function(v) v[1:min_length])