Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Define XBT_ATTRIB_DEPRECATED_v326.
[simgrid.git] / docs / source / tuto_s4u / draw_gantt.R
1 #!/usr/bin/env Rscript
2 args = commandArgs(trailingOnly=TRUE)
3 library(ggplot2)
4 library(pajengr)
5
6 # Load and relabel the data
7 df = pajeng_read(args[1])
8 names(df$state) = c("Type", "Actor", "Container", "Start", "End", "Duration", "Level", "State");
9
10 # Actually draw the graph
11 p = ggplot(df$state) + geom_segment(aes(x=Start, xend=End, y=Actor, yend=Actor,color=State), size=5);
12
13 # Cosmetics to compact the resulting graph
14 p.height <- length(unique(df$state$Actor)) * 0.05 + 2;
15 pdf(height = p.height)
16
17 # Produce the pdf file
18 plot(p)
19 dev.off()