From 1922765daa132f3233c83d0e15309544f9fb6128 Mon Sep 17 00:00:00 2001
From: Johannes Mey <johannes.mey@tu-dresden.de>
Date: Sat, 23 Mar 2019 18:47:26 +0100
Subject: [PATCH] update plots

---
 .../trainbenchmark-reporting/combined.R       | 36 +++++++++++++++----
 .../trainbenchmark-reporting/individual.R     | 27 ++++++++++++--
 2 files changed, 54 insertions(+), 9 deletions(-)

diff --git a/trainbenchmark/trainbenchmark-reporting/combined.R b/trainbenchmark/trainbenchmark-reporting/combined.R
index 985cc3265..bbf3b4659 100644
--- a/trainbenchmark/trainbenchmark-reporting/combined.R
+++ b/trainbenchmark/trainbenchmark-reporting/combined.R
@@ -120,11 +120,23 @@ for (scenario in c("inject", "repair")) {
 
     p = ggplot(df) + #na.omit(df)) +
       aes(x = as.factor(Model), y = Time) +
-    # labs(title = paste("Individual query execution time,", phase, "phase"), x = "Model size\n#Elements", y = "Execution times [ms]") +
-      labs(title = element_blank(), x = element_blank(), y = element_blank()) +
+    labs(title = paste("Individual query execution time,", phase, "phase"), x = "Model size\n#Elements", y = "Execution times [ms]") +
 
       geom_point(aes(col = Tool, shape = Tool), size = 2.0) +
-      scale_shape_manual(values = c(1,16, 0,15, 2,17, 5,18, 8,10)) +
+      scale_shape_manual( values = c(1,16, 0,15, 2,17, 5,18, 8,10),
+                            labels = c( "Name Lookup",
+                                        "Name Lookup (Incremental)",
+                                        "Intrinsic References",
+                                        "Intrinsic References (Incremental)",
+                                        "Relational RAGs (Manual Serialization)",
+                                        "Relational RAGs (Manual Serialization, Incremental)",
+                                        "Relational RAGs",
+                                        "Relational RAGs (Incremental)",
+                                        "TinkerGraph",
+                                        "VIATRA (Incremental)"
+                                        ),
+                            guide=guide_legend(ncol=3,nrow=4)
+        ) +
       # scale_shape_manual(values = c(1,21, 0,22, 2,24, 5,23, 6,25)) +
       scale_colour_manual(values = c( "#56B4E9", "#56B4E9", # Sky blue - Name Lookup
                                       "#009E73", "#009E73", # Bluish green - Intrinsic References
@@ -133,13 +145,23 @@ for (scenario in c("inject", "repair")) {
                                       "#D55E00", # Vermillion - Tinkergraph
                                       "#CC79A7", # ReddishPurple - VIATRA
                                       "#F0E442"  # Yellow
+                                        ),
+                            labels = c( "Name Lookup",
+                                        "Name Lookup (Incremental)",
+                                        "Intrinsic References",
+                                        "Intrinsic References (Incremental)",
+                                        "Relational RAGs (Manual Serialization)",
+                                        "Relational RAGs (Manual Serialization, Incremental)",
+                                        "Relational RAGs",
+                                        "Relational RAGs (Incremental)",
+                                        "TinkerGraph",
+                                        "VIATRA (Incremental)"
                                       )
       ) +
       geom_line(aes(col = Tool, group = Tool), size = 0.5) +
       # scale_linetype_manual(values=c(0,1,2,3,4,5,6,7,8,9), na.value="blank") +
       scale_x_discrete(breaks = xbreaks, labels = xlabels) +
       scale_y_log10(breaks = ybreaks, minor_breaks=yminor_breaks, labels = ylabels, limits = c(2e-3,2e4), expand = c(0, 0)) +
-      guides(color = guide_legend(ncol = 5)) +
       theme_bw() +
       theme(
         plot.title = element_blank(), # element_text(hjust = 0.5),
@@ -148,7 +170,7 @@ for (scenario in c("inject", "repair")) {
         legend.title = element_blank(),
         strip.text.x = element_blank(),
         legend.position = "none", # "none", #
-        axis.text = element_text(size = 12)
+        axis.text = element_text(size = 11)
         #, panel.grid.minor = element_blank()
       )
     fnTmp <- paste("../diagrams/recent/benchmark/", scenario, "/", phase.filename, "-", scenario, "-tmp.pdf", sep="")
@@ -156,8 +178,8 @@ for (scenario in c("inject", "repair")) {
     ggsave(
       plot = p,
       filename = fnTmp,
-      width = 80,
-      height = 100,
+      width = 100,
+      height = 130,
       units = "mm"
     )
     embed_fonts(fnTmp, outfile=fn)
diff --git a/trainbenchmark/trainbenchmark-reporting/individual.R b/trainbenchmark/trainbenchmark-reporting/individual.R
index b43b5f2c9..e0238176c 100644
--- a/trainbenchmark/trainbenchmark-reporting/individual.R
+++ b/trainbenchmark/trainbenchmark-reporting/individual.R
@@ -130,7 +130,20 @@ for (scenario in c("inject", "repair")) {
         aes(x = as.factor(Model), y = Time) +
         labs(title = paste("Individual query execution time,", phase, "phase"), x = "Model size\n#Elements", y = "Execution times [ms]") +
         geom_point(aes(col = Tool, shape = Tool), size = 2.0) +
-        scale_shape_manual(values = c(1,16, 0,15, 2,17, 5,18, 8,10)) +
+        scale_shape_manual( values = c(1,16, 0,15, 2,17, 5,18, 8,10),
+                            labels = c( "Name Lookup",
+                                        "Name Lookup (Incremental)",
+                                        "Intrinsic References",
+                                        "Intrinsic References (Incremental)",
+                                        "Relational RAGs (Manual Serialization)",
+                                        "Relational RAGs (Manual Serialization, Incremental)",
+                                        "Relational RAGs",
+                                        "Relational RAGs (Incremental)",
+                                        "TinkerGraph",
+                                        "VIATRA (Incremental)"
+                                        ),
+                            guide=guide_legend(ncol=3,nrow=4)
+        ) +
         # scale_shape_manual(values = c(1,21, 0,22, 2,24, 5,23, 6,25)) +
         scale_colour_manual(values = c( "#56B4E9", "#56B4E9", # Sky blue - Name Lookup
                                         "#009E73", "#009E73", # Bluish green - Intrinsic References
@@ -139,6 +152,17 @@ for (scenario in c("inject", "repair")) {
                                         "#D55E00", # Vermillion - Tinkergraph
                                         "#CC79A7", # ReddishPurple - VIATRA
                                         "#F0E442"  # Yellow
+                                        ),
+                            labels = c( "Name Lookup",
+                                        "Name Lookup (Incremental)",
+                                        "Intrinsic References",
+                                        "Intrinsic References (Incremental)",
+                                        "Relational RAGs (Manual Serialization)",
+                                        "Relational RAGs (Manual Serialization, Incremental)",
+                                        "Relational RAGs",
+                                        "Relational RAGs (Incremental)",
+                                        "TinkerGraph",
+                                        "VIATRA (Incremental)"
                                         )
         ) +
         geom_line(aes(col = Tool, group = Tool), size = 0.5) +
@@ -146,7 +170,6 @@ for (scenario in c("inject", "repair")) {
         scale_x_discrete(breaks = xbreaks, labels = xlabels) +
         scale_y_log10(breaks = ybreaks, minor_breaks=yminor_breaks, labels = ylabels, limits = c(2e-3,2e4), expand = c(0, 0)) +
         facet_grid_paginate(~ Workload, nrow=1, ncol = 1, page=cpage, scale = "free") +
-        guides(color = guide_legend(ncol = 5)) +
         theme_bw() +
         theme(
           plot.title = element_blank(), # element_text(hjust = 0.5),
-- 
GitLab