#!/usr/bin/env python import numpy as np #numerical stuff import sys # import argparse import prettyplotlib as ppl # makes nicer colors and generally better to look at graphs import matplotlib.pyplot as plt import matplotlib as mpl from prettyplotlib import brewer2mpl # parser = argparse.ArgumentParser(description='Generate graph.') # parser.add_argument('filename', type=str, nargs=1, default='exp-02.csv', help='Filename') # args = parser.parse_args() # change font to Open Sans (has some kerning issues, though) mpl.rcParams.update({'font.family':'Open Sans'}) # mpl.rcParams.update({'text.usetex':'true'}) # get name of file to process # inputFileName = args.filename[0] inputFileName = "exp-04.csv" # load csv file with EPOCHTIME;NOFPROCESSES data = np.loadtxt(inputFileName) # data = np.loadtxt(inputFileName, delimiter=";") # fig, ax = plt.subplots(figsize=(14,8)) #shorthand fig = plt.figure(figsize=(7,4)) ax = fig.add_subplot(1, 1, 1) ax.set_xlabel("Number of Hits") ax.set_ylabel("Performance, Mhits/s") ax.grid(axis='y', color='0.3', linestyle=':', antialiased=True) ppl.plot(ax, data[:,0], data[:,4], label="Host Streams (bunch size 2000 ns)", linewidth=2) ppl.plot(ax, data[:,0], data[:,6], label=r"Dynamic Parallelism (bunch size 1000 ns)", linewidth=2) # position of ticks plt.tick_params(axis='both', which='major', direction='in', bottom=True) ppl.legend(ax, loc=0, prop={'size':12}) outputfilename = 'dyn-vs-hstream-perf' outputfilename += '' # fig.savefig('chromeProcessesPerTime.png', dpi=200) fig.savefig(outputfilename + '.pdf', dpi=50, bbox_inches='tight') ppl.plot(ax, data[:,0], data[:,5], label="Joined Kernel (bunch size 1000 ns)", linewidth=2) # position of ticks plt.tick_params(axis='both', which='major', direction='in', bottom=True) ppl.legend(ax, loc=0, prop={'size':12}) outputfilename = 'dyn-vs-other-perf' outputfilename += '' # fig.savefig('chromeProcessesPerTime.png', dpi=200) fig.savefig(outputfilename + '.pdf', dpi=50, bbox_inches='tight') # fig.savefig('chromeProcessesPerTime.svg', dpi=200) #plt.show()