From f3180a35cc37106ea4fd0ad7b5d00c6593e76db7 Mon Sep 17 00:00:00 2001 From: Alwin Berger Date: Thu, 23 Mar 2023 13:20:23 +0100 Subject: [PATCH] plot min and max lines --- fuzzers/FRET/benchmark/plot_multi.r | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/fuzzers/FRET/benchmark/plot_multi.r b/fuzzers/FRET/benchmark/plot_multi.r index b77be71369..dd60cfde4e 100644 --- a/fuzzers/FRET/benchmark/plot_multi.r +++ b/fuzzers/FRET/benchmark/plot_multi.r @@ -30,6 +30,14 @@ DRAW_WC = worst_case > 0 LEGEND_POS="topleft" #LEGEND_POS="bottomright" +alpha <- function(col, alpha=1){ + if(missing(col)) + stop("Please provide a vector of colours.") + apply(sapply(col, col2rgb)/255, 2, + function(x) + rgb(x[1], x[2], x[3], alpha=alpha)) +} + # Trimm a list of data frames to common length trim_data <- function(input,len=NULL) { if (is.null(len)) { @@ -139,13 +147,17 @@ plot(c(1,length(one_frame[[1]])),c(ylow,yhigh), col='white', xlab="Iters", ylab= for (t in seq_len(length(typenames))) { proj = one_frame[seq(1, dim(one_frame)[1], by=max(1, length(one_frame[[1]])/(10*w_))),] #points(proj[c('iters',typenames[t])], col=MY_COLORS_[t], pch='.') - drawlines = ml2lines(one_frame[[typenames[t]]]) - lines(drawlines, col=MY_COLORS_[t]) + avglines = ml2lines(one_frame[[typenames[t]]]) + lines(avglines, col=MY_COLORS_[t]) if (exists("RIBBON") && RIBBON=='both') { - points(proj[c('iters',sprintf("%s_min",typenames[t]))], col=MY_COLORS_[t], pch='.') - points(proj[c('iters',sprintf("%s_max",typenames[t]))], col=MY_COLORS_[t], pch='.') + milines = ml2lines(one_frame[[sprintf("%s_min",typenames[t])]]) + malines = ml2lines(one_frame[[sprintf("%s_max",typenames[t])]]) + lines(milines, col=MY_COLORS_[t], lty='dashed') + lines(malines, col=MY_COLORS_[t], lty='dashed') + #points(proj[c('iters',sprintf("%s_min",typenames[t]))], col=MY_COLORS_[t], pch='.') + #points(proj[c('iters',sprintf("%s_max",typenames[t]))], col=MY_COLORS_[t], pch='.') } - if (RIBBON != '') { + if (exists("RIBBON") && RIBBON != '') { for (i in seq_len(dim(proj)[1])) { row = proj[i,] x_ <- row['iters'][[1]]