if args.only_mean: print_order = ["gmean"] if args.workload_name is not None: output = [args.workload_name.rjust(just)] elif args.workload_file is not None: output = [os.path.basename(args.workload_file).rjust(just)] else: output = ["gmean".rjust(just)] else: print_order = workload_order output = [workload.rjust(just) for workload in print_order] for name in set_order: if name not in args.ignore: output = [cur + "," + str(round(val,args.round)).ljust(args.round+2,'0') for cur, val in \ zip(output, kv.values(name, key_order = print_order))] if args.print_table: if not args.no_header: print ','.join(['%s' % (set_name) for set_name in set_order]) for line in output: print line # ------------------------------------------------------------------------------ # Plot data if requested # ------------------------------------------------------------------------------ if args.plot: plot = PlotLib() plot.set_plot_dimensions(args.plot_width, args.plot_height)
for i,mech in enumerate(mechanisms): data[mech][key] = values[i] kv = KeyValueData() for name, values in data.iteritems(): kv.add_data(name, values) kv.extract_keys() print (kv.keys()) #mechanisms = mechanisms[1:] plot = PlotLib() legend = mechanisms[:] plot.set_y_tics_step(0.1) plot.set_y_tics_shift(0) plot.set_legend_shift(-50,-10) plot.set_plot_dimensions(220,80) plot.set_scale(0.5) plot.set_y_tics_font_size("scriptsize") plot.set_x_tics_font_size("scriptsize") plot.set_y_label_font_size("small") plot.set_x_label_font_size("small") plot.set_ceiling(0.85) plot.xlabel("Workloads", yshift = -10, fontsize = "small", options = "") plot.ylabel(sys.argv[2], xshift = -2, fontsize = "small", options = "") plot.column_stacked_bars(workload_order, [kv.values(name, key_order = workload_order) for name in mechanisms], legend, key_padding = 0.3, value_base = 0) plot.save_pdf(os.path.basename(sys.argv[1])) plot.save_tikz(os.path.basename(sys.argv[1]) + ".tex")
for name, values in data.iteritems(): kv.add_data(name, values) kv.extract_keys() print(kv.keys()) #mechanisms = mechanisms[1:] plot = PlotLib() legend = mechanisms[:] plot.set_y_tics_step(0.1) plot.set_y_tics_shift(0) plot.set_legend_shift(-50, -10) plot.set_plot_dimensions(220, 80) plot.set_scale(0.5) plot.set_y_tics_font_size("scriptsize") plot.set_x_tics_font_size("scriptsize") plot.set_y_label_font_size("small") plot.set_x_label_font_size("small") plot.set_ceiling(0.85) plot.xlabel("Workloads", yshift=-10, fontsize="small", options="") plot.ylabel(sys.argv[2], xshift=-2, fontsize="small", options="") plot.column_stacked_bars( workload_order, [kv.values(name, key_order=workload_order) for name in mechanisms], legend, key_padding=0.3, value_base=0) plot.save_pdf(os.path.basename(sys.argv[1])) plot.save_tikz(os.path.basename(sys.argv[1]) + ".tex")