@@ -23,6 +23,19 @@ experiment_names <- c(
2323 " rgbe3" = " RGB-R_RGB-G_RGB-B_DVS"
2424)
2525
26+ experiment_ids <- c(
27+ " o-bs-tf_hsv" = " 01" ,
28+ " o-bs-tf" = " 02" ,
29+ " o-tf-o_hsv" = " 03" ,
30+ " o-tf-o" = " 04" ,
31+ " original_bg-sub_temp_filter_rgb" = " 05" ,
32+ " original_bg-sub_temp-filter_hsv" = " 06" ,
33+ " original_bg-sub_temp-filter" = " 07" ,
34+ " original_hsv" = " 08" ,
35+ " original" = " 09" ,
36+ " rgbe3" = " 10"
37+ )
38+
2639
2740
2841colors = c(" #FFFFFF" ," #00BFC4" ," #C77CFF" , " #7CAE00" ," #F8766D" )
@@ -56,6 +69,7 @@ for (file in files) {
5669df <- do.call(rbind , df_list )
5770df <- add_filename_column(df )
5871df $ ExperimentName <- experiment_names [df $ Filename ]
72+ df $ ExperimentID <- experiment_ids [df $ Filename ]
5973
6074library(ggplot2 )
6175
@@ -87,25 +101,25 @@ create_boxplot <- function(data, file_column, value_column, color, xlabel = "Exp
87101 vjust = - 0.5 ,
88102 position = position_dodge(width = 0.75 ),
89103 show.legend = FALSE ) +
90- labs(title = " Boxplot for Each File " , x = xlabel , y = ylabel ) +
104+ labs(title = paste0( " Distribution of " , ylabel , " scores " ) , x = xlabel , y = ylabel ) +
91105 theme_minimal() +
92- theme(axis.text.x = element_text(angle = 90 , vjust = 0.5 , hjust = 1 ))
106+ theme(plot.title = element_text(size = 10 ))
93107
94108 # Print the boxplot
95109 return (p )
96110}
97111
98112
99113
100- factor <- 1
101- p <- create_boxplot(df , " ExperimentName" , " Value" ,color , ylabel = ylabel )
114+ height_factor <- 1
115+ width_size <- 8.50714756389
116+ p <- create_boxplot(df , " ExperimentID" , " Value" ,color , ylabel = ylabel )
102117ggsave(
103118 filename = file.path(" visualizations" , " boxplots" , paste0(parameter , " .png" )),
104119 plot = p ,
105- width = 21 * factor ,
106- height = 16 * factor ,
120+ width = width_size ,
121+ height = width_size * height_factor ,
107122 units = " cm" ,
108- dpi = 450
109123)
110124cat(" Saved: " , parameter , " \n " )
111125
0 commit comments