do_boxplots.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 #
00003 # GIT version. Please do not edit this file.
00004 # Make a copy and edit the copy.
00005 #
00006 
00007 import sys
00008 import os
00009 
00010 
00011 # L = <list of experiments to compare and label to use in the plot (no spaces allowed in the label!!!)>
00012 
00013 L = []
00014 
00015 
00016 # Read file with experiments to plot
00017 
00018 if (len(sys.argv)<4):
00019     print "Use: do_boxplots.py <experiments_file> <plot_title> <outfilename_prefix> <label_1> ... <label_n>"
00020     sys.exit(0)
00021 
00022 exptoplot = sys.argv[1]
00023 plot_title = sys.argv[2]
00024 outfile = sys.argv[3]
00025 
00026 k = 4; # index for the labels
00027 
00028 #print "File with exp to plot: ",exptoplot
00029 
00030 f = open(exptoplot,'r')
00031 
00032 for line in f:
00033     e = line.rstrip('\r\n ')
00034     if (len(e)>0 and e[0]!='#'):
00035         L.append(e)
00036         L.append(sys.argv[k])
00037         k=k+1
00038 
00039 f.close
00040 
00041 # Run the R script
00042 
00043 cmd = 'Rscript stats/boxplots.R "'+plot_title+'" '
00044 lfiles = ""
00045 
00046 for i in range(0,len(L)/2):
00047   lfiles = lfiles + "%s_idleness.csv %s " %(L[i*2],L[i*2+1])
00048 
00049 cmd = cmd + lfiles
00050 print cmd
00051 os.system(cmd)
00052 
00053 cmd = 'mv Rplots.pdf '+outfile+"_boxplots.pdf"
00054 os.system(cmd)
00055 
00056 


patrolling_sim
Author(s):
autogenerated on Thu Jun 6 2019 20:27:09