#!/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'}) # get name of file to process # inputFileName = args.filename[0] inputFileName = "exp-10.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) ppl.plot(ax, data[:,0], data[:,3], label="Testing: All Skewlets", linewidth=2) ppl.plot(ax, data[:,0], data[:,4], label="Testing: Binning", linewidth=2) # ax.set_xticks(printList) # ax.set_xticklabels(humanName); ax.set_xlabel("Number of Hits") ax.set_ylabel("Performance, Mhits/s") # ax.axis('tight') # ax.set_yscale('log') # ax.set_xscale('log') ax.grid(axis='y', color='0.3', linestyle=':', antialiased=True) # position of ticks ppl.legend(ax, loc=0) plt.tick_params(axis='both', which='major', direction='in', bottom=True) outputfilename = 'all-vs-bins-perf' # fig.savefig('chromeProcessesPerTime.png', dpi=200) fig.savefig(outputfilename + '.pdf', dpi=50, bbox_inches='tight') # fig, ax = plt.subplots(figsize=(14,8)) #shorthand fig = plt.figure(figsize=(7,4)) ax = fig.add_subplot(1, 1, 1) ppl.plot(ax, data[:,0], data[:,1], label="Testing: All Skewlets", linewidth=2) ppl.plot(ax, data[:,0], data[:,2], label="Testing: Binning", linewidth=2) # ax.set_xticks(printList) # ax.set_xticklabels(humanName); ax.set_xlabel("Number of Hits") ax.set_ylabel("Time, s") # ax.axis('tight') # ax.set_yscale('log') # ax.set_xscale('log') ax.grid(axis='y', color='0.3', linestyle=':', antialiased=True) # position of ticks ppl.legend(ax, loc=0) plt.tick_params(axis='both', which='major', direction='in', bottom=True) outputfilename = 'all-vs-bins-time' # fig.savefig('chromeProcessesPerTime.png', dpi=200) fig.savefig(outputfilename + '.pdf', dpi=50, bbox_inches='tight') # fig.savefig('chromeProcessesPerTime.svg', dpi=200) #plt.show()