#!/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 from itertools import cycle import colorsys # 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'}) color_cycle = cycle(mpl.rcParams['axes.color_cycle']) # get name of file to process # inputFileName = args.filename[0] inputFileName = "exp-01.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) currentColor = next(color_cycle) ppl.plot(ax, data[:,0], data[:,1], label="Runtime", linewidth=2, color=currentColor) fig2 = plt.figure(figsize=(7,4)) ax2 = fig2.add_subplot(1, 1, 1) currentColor = next(color_cycle) ppl.plot(ax2, data[:,0], data[:,2], label="Performance", linewidth=2, color=currentColor) # ax.set_xticks(printList) # ax.set_xticklabels(humanName); ax.set_xlabel("Number of Hits") ax.set_ylabel("Time / s") ax.grid(axis='y', color='0.3', linestyle=':', antialiased=True) ax2.set_xlabel("Number of Hits") ax2.set_ylabel("Performance / Mhits/s") ax2.grid(axis='y', color='0.3', linestyle=':', antialiased=True) # ax.axis('tight') # ax.set_yscale('log') # ax.set_xscale('log') # position of ticks ppl.legend(ax, loc=0, prop={'size':12}) ppl.legend(ax2, loc=0, prop={'size':12}) plt.tick_params(axis='both', which='major', direction='in', bottom=True) # fig.savefig('chromeProcessesPerTime.png', dpi=200) fig.savefig("bunched-time--python" + '.pdf', dpi=50, bbox_inches='tight') fig2.savefig("bunched-perf--python" + '.pdf', dpi=50, bbox_inches='tight') # fig.savefig('chromeProcessesPerTime.svg', dpi=200) plt.show()