]> AND Private Git Repository - loba-papers.git/blobdiff - loba-besteffort/data/script.r
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Use grey levels for graphs.
[loba-papers.git] / loba-besteffort / data / script.r
index ec331ead123dfa276aa0e5bbee253c51bb88e5c3..68d78a90b79980bd6f8d0d4ee7cb359587e82af4 100644 (file)
@@ -131,23 +131,30 @@ draw2 <- function(dset = ds,
 
   ## remove first column (aka "Algo")
   dset.mat <- as.matrix(dset.wide[-1])
 
   ## remove first column (aka "Algo")
   dset.mat <- as.matrix(dset.wide[-1])
+  nc <- nrow(dset.mat)
 
   dset.plot <- dset.mat[, c(FALSE,FALSE,TRUE)]
   barplot(dset.plot, beside=TRUE,
           names.arg=sub("^[^.]*\\.", "", colnames(dset.plot)),
 
   dset.plot <- dset.mat[, c(FALSE,FALSE,TRUE)]
   barplot(dset.plot, beside=TRUE,
           names.arg=sub("^[^.]*\\.", "", colnames(dset.plot)),
-          col=rainbow(nrow(dset.mat), s=.5))
+          col=gray.colors(nc)
+#          col=rainbow(nc, s=.5)
+          )
 
   dset.plot <- dset.mat[, c(FALSE,TRUE,FALSE)]
   barplot(dset.plot, beside=TRUE,
           axes=FALSE, axisnames=FALSE, add=TRUE,
           legend.text=TRUE,
           args.legend=list(x="topleft", inset=c(.02,0), title="Algorithms"),
 
   dset.plot <- dset.mat[, c(FALSE,TRUE,FALSE)]
   barplot(dset.plot, beside=TRUE,
           axes=FALSE, axisnames=FALSE, add=TRUE,
           legend.text=TRUE,
           args.legend=list(x="topleft", inset=c(.02,0), title="Algorithms"),
-          col=rainbow(nrow(dset.mat)))
+          col=gray.colors(nc)
+#          col=rainbow(nc)
+          )
 
   dset.plot <- dset.mat[, c(TRUE,FALSE,FALSE)]
   barplot(dset.plot, beside=TRUE,
           axes=FALSE, axisnames=FALSE, add=TRUE,
 
   dset.plot <- dset.mat[, c(TRUE,FALSE,FALSE)]
   barplot(dset.plot, beside=TRUE,
           axes=FALSE, axisnames=FALSE, add=TRUE,
-          col=rainbow(nrow(dset.mat), v=.5))
+          col="white"
+#          col=rainbow(nc, v=.5)
+          )
 
   ## finally, set titles
   t <- paste0(dset$Mode[1], dset$Distrib[1], " / ",
 
   ## finally, set titles
   t <- paste0(dset$Mode[1], dset$Distrib[1], " / ",
@@ -186,6 +193,7 @@ msg("... with draw2()...")
 draw2(draw_distrib="N")
 }
 
 draw2(draw_distrib="N")
 }
 
+pdf.options(colormodel="grey")
 system("mkdir -pv graphs")
 for (m in c("R", "I")) {
   for (d in c("1", "N")) {
 system("mkdir -pv graphs")
 for (m in c("R", "I")) {
   for (d in c("1", "N")) {
@@ -193,11 +201,13 @@ for (m in c("R", "I")) {
       for (t in c("line", "torus", "hcube")) {
         for (p in c("grid", "cluster")) {
           message(sprintf(">>> Drawing: %s%s / %s / %s / %s", m, d, r, p, t))
       for (t in c("line", "torus", "hcube")) {
         for (p in c("grid", "cluster")) {
           message(sprintf(">>> Drawing: %s%s / %s / %s / %s", m, d, r, p, t))
-          pdf(file=sprintf("graphs/%s%s-%s-%s-%s.pdf", m, d, r, p, t))
+          filename <- sprintf("graphs/%s%s-%s-%s-%s.pdf", m, d, r, p, t)
+          pdf(file=filename)
           draw2(#subset(ds, grepl("[lt]_plain", Algo)),
                 draw_mode=m, draw_distrib=d, draw_ratio=r,
                 draw_topo=t, draw_platform=p)
           dev.off()
           draw2(#subset(ds, grepl("[lt]_plain", Algo)),
                 draw_mode=m, draw_distrib=d, draw_ratio=r,
                 draw_topo=t, draw_platform=p)
           dev.off()
+          embedFonts(file=filename, options="-dPDFSETTINGS=/prepress")
         }
       }
     }
         }
       }
     }