Esempio n. 1
0
def args_to_csv(argn):
    stats = []
    for a in sys.argv[2:argn + 2]:
        stats.append(CSVStats(a))
    plot_show(argn)
    return stats
Esempio n. 2
0
def read_csvs_xname(xname, *values):
    stats = []
    for a in values:
        file = a + '.csv'
        stats.append(CSVStats(file, xname))
    return stats
Esempio n. 3
0
    stats = []
    for a in sys.argv[2:argn + 2]:
        stats.append(CSVStats(a))
    plot_show(argn)
    return stats


option = sys.argv[1]

if option == "0":
    cothority, jvss, naive, naive_sc, ntree = args_to_csv(5)
    plotAvgMM(cothority, jvss, naive, ntree)
elif option == "1":
    cothority, jvss, naive, naive_sc, ntree = args_to_csv(5)
    CoJVTimeBars(cothority, jvss, naive)
elif option == "2":
    cothority, jvss, naive, naive_sc, ntree = args_to_csv(5)
    CoJVTimeArea(cothority, jvss)
elif option == "3":
    cothority, jvss, naive, naive_sc, ntree = args_to_csv(5)
    SigCheck(naive, naive_sc)
elif option == "4":
    Over(*args_to_csv(3))
elif option == "5":
    plot_show(1)
    PlotBF(CSVStats(sys.argv[2], "bf"))
elif option == "6":
    plot_show(1)
    stamp = CSVStats(sys.argv[2], "rate")
    PlotStamp(stamp)
Esempio n. 4
0
color1_dark = 'green'
color2_light = 'lightblue'
color2_dark = 'blue'
color3_light = 'yellow'
color3_dark = 'brown'
color4_light = 'pink'
color4_dark = 'red'
mplot = MPlot()

def plot_save(file):
    mplot.pngname = file
    mplot.show_fig = False

stats = "round_wall"
argn = len(sys.argv)
if argn < 2:
    print "Syntax is:"
    print "plot.py file.csv [stat]"
    print "where stat is one of {round_wall, round_system, round_user}"
    sys.exit(1)

if argn > 2:
    stats = sys.argv[2]

data = CSVStats(sys.argv[1], "hosts")
mplot.plotPrepareLogLog()
na = mplot.plotMMA(data, stats, color1_light, 0,
                    dict(label=sys.argv[1], linestyle='-', marker='s', color=color2_dark, zorder=3))
plt.legend(loc='upper left')
plt.ylabel('Time for verification')
mplot.plotEnd()
Esempio n. 5
0
def args_to_csv(argn, xname="Peers"):
    stats = []
    for a in sys.argv[2:argn + 2]:
        stats.append(CSVStats(a, xname))
    plot_show(argn)
    return stats
Esempio n. 6
0
    for a in sys.argv[2:argn + 2]:
        stats.append(CSVStats(a, xname))
    plot_show(argn)
    return stats


option = sys.argv[1]

if option == "0":
    cothority, jvss, naive, naive_sc, ntree = args_to_csv(5)
    plotAvgMM(cothority, jvss, naive, ntree)
elif option == "1":
    cothority, jvss, naive, naive_sc, ntree = args_to_csv(5)
    CoJVTimeBars(cothority, jvss, naive)
elif option == "2":
    cothority, jvss, naive, naive_sc, ntree = args_to_csv(5)
    CoJVTimeArea(cothority, jvss)
elif option == "3":
    cothority, jvss, naive, naive_sc, ntree = args_to_csv(5)
    SigCheck(naive, naive_sc)
elif option == "4":
    Over(*args_to_csv(3))
elif option == "5":
    PlotMultiBF(*args_to_csv(1, "bf"))
elif option == "6":
    plot_show(1)
    stamp = CSVStats(sys.argv[2], "rate")
    PlotStamp(stamp)
elif option == "7":
    PlotMultiBF(*args_to_csv(4, "bf"))
Esempio n. 7
0
from mplot import MPlot
from stats import CSVStats

color1_light = 'lightgreen'
color1_dark = 'green'
color2_light = 'lightblue'
color2_dark = 'blue'
color3_light = 'yellow'
color3_dark = 'brown'
color4_light = 'pink'
color4_dark = 'red'

mplot = MPlot()
mplot.plotPrepareLogLog()

mplot.show_fig = True
jvss = CSVStats('test_naive_multi.csv').get_values('round_wall')
plt.plot(jvss.x,
         jvss.avg,
         label='JVSS',
         linestyle='-',
         marker='^',
         color=color2_dark,
         zorder=3)
mplot.plotFilledLegend(jvss.x,
                       jvss.min,
                       jvss.max,
                       "min-max",
                       color2_light,
                       z=0)
mplot.plotEnd()