import re
import os
import pprint
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import collections
from matplotlib.backends.backend_pdf import PdfPages

class RunResult:

  def __init__(self, outputFile):
    self.prj = None
    self.matrix = None
    self.gflops_est = 0
    self.outputFile = outputFile
    self.loadData(outputFile)

  def loadData(self, outputFile):
    m = re.search(r'run_(\w*maxrows\d*)_([\w-]*).mtx', outputFile)
    if m:
      self.prj = m.group(1)
      self.matrix = m.group(2)

    with open(outputFile, 'r') as f:
      for l in f:
        m = re.search(r'Result Simple Gflops \(est\)=(\d*(.\d*)?)', l)
        if m:
          self.gflops_est = float(m.group(1))

  def __str__(self):
    return 'gflops_est = {0}, matrix = {1}, prj = {2}'.format(
        self.gflops_est, self.matrix, self.prj)

  def __repr__(self):
    return self.__str__()


def main():
  runResults = []
  # Traverse files, extract matrix, architecture and params
  for f in [f for f in os.listdir('.') if os.path.isfile(f)]:
      if f.startswith('run_Spmv'):
        runResults.append(RunResult(f))

  df = pd.DataFrame([[r.prj, r.matrix, r.gflops_est] for r in runResults])
  grouped = df.groupby(0)
  groups = []
  names = []
  for name, group in grouped:
    group.set_index(1, inplace=True)
    group.sort_index(inplace=True)
    groups.append(group[2])
    names.append(name)

  new_df = pd.concat(groups, axis=1)
  new_df.columns = names

  bar = new_df.plot(kind='bar')
  # bar.get_figure().savefig('est_gflops.pdf')
  plt.show()


if __name__ == '__main__':
  main()

@@ -171,16 +171,39 @@
 fPages%0A%0A
+import seaborn as sns%0A%0A
 class Ru
@@ -1340,24 +1340,26 @@
 ce=True)%0A   
+ #
  group.sort_
@@ -1499,58 +1499,214 @@
 %0A%0A  
-bar = new_df.plot(kind='bar')%0A  # bar.get_figure()
+sns.set_style(%22white%22)%0A  sns.set_palette(sns.color_palette(%22cubehelix%22, 13))%0A  bar = new_df.plot(kind='bar')%0A  sns.despine()%0A  fig = bar.get_figure()%0A  fig.set_size_inches(15, 15)%0A  fig.tight_layout()%0A  fig
 .sav
@@ -1729,16 +1729,18 @@
 .pdf')%0A 
+ #
  plt.sho

Use seaborn for plot customisation