X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c4ccdd571ccef28dd30ff1e04690482710dbeac2..a5a8281d1b8c42bbdb10d492d7251b35759ea32d:/docs/source/tuto_s4u/draw_gantt.R diff --git a/docs/source/tuto_s4u/draw_gantt.R b/docs/source/tuto_s4u/draw_gantt.R index 5fd230b83e..f3ab44d450 100644 --- a/docs/source/tuto_s4u/draw_gantt.R +++ b/docs/source/tuto_s4u/draw_gantt.R @@ -1,16 +1,17 @@ #!/usr/bin/env Rscript args = commandArgs(trailingOnly=TRUE) library(ggplot2) +library(pajengr) # Load and relabel the data -df = read.csv(args[1], header=F, strip.white=T) -names(df) = c("Type", "Actor", "Container", "Start", "End", "Duration", "Level", "State"); +df = pajeng_read(args[1]) +names(df$state) = c("Type", "Actor", "Container", "Start", "End", "Duration", "Level", "State"); # Actually draw the graph -p = ggplot(df) + geom_segment(aes(x=Start, xend=End, y=Actor, yend=Actor,color=State), size=5); +p = ggplot(df$state) + geom_segment(aes(x=Start, xend=End, y=Actor, yend=Actor,color=State), size=5); # Cosmetics to compact the resulting graph -p.height <- length(unique(df$Actor)) * 0.05 + 2; +p.height <- length(unique(df$state$Actor)) * 0.05 + 2; pdf(height = p.height) # Produce the pdf file