From f087837078e08cbb366b0aec94ac66c3bcc0f1ac Mon Sep 17 00:00:00 2001
From: Andreas Ziegler <andreas.ziegler@fau.de>
Date: Sat, 29 Jan 2022 22:46:17 +0100
Subject: [PATCH] scripts: update plotting files

---
 scripts/histogram_function_sizes.py | 3 +++
 scripts/plot_codesize.py            | 5 +++--
 scripts/plot_runtimes.py            | 2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/scripts/histogram_function_sizes.py b/scripts/histogram_function_sizes.py
index a98841f..2a8d43b 100755
--- a/scripts/histogram_function_sizes.py
+++ b/scripts/histogram_function_sizes.py
@@ -2,6 +2,7 @@
 
 import collections
 import matplotlib.pyplot as plt
+import numpy
 import pandas
 import statistics
 import sys
@@ -33,7 +34,9 @@ print(' * Statistics:')
 print('  * Number of ranges: {}'.format(len(all_ranges)))
 print('  * .. Mean:   {}'.format(df["Function Size"].mean()))
 print('  * .. Median: {}'.format(df["Function Size"].median()))
+print('  * .. 95th quantile: {}'.format(df["Function Size"].quantile(.95)))
 print('  * .. Max:    {}'.format(df["Function Size"].max()))
+print('  * .. Total number of bytes: {}'.format(df["Function Size"].sum()))
 
 print(' * Plotting...')
 xlim = (-10, max_x)
diff --git a/scripts/plot_codesize.py b/scripts/plot_codesize.py
index 5fa0e5a..66e92d4 100644
--- a/scripts/plot_codesize.py
+++ b/scripts/plot_codesize.py
@@ -42,6 +42,7 @@ ax = seaborn.barplot(x='filename',
                      hue='variable',
                      data=data)
 ax.ticklabel_format(style='plain', axis='y')
+ax.set_xticklabels(ax.get_xticklabels(), rotation=45, horizontalalignment='right')
 
 change_width(ax, .30)
 
@@ -58,8 +59,8 @@ plt.legend(handles,
 ax.set_xlabel('Library filename')
 ax.set_ylabel('Number of code bytes in file')
 ax.set_ylim((0, 1100000))
-ax.bar_label(handles[0], padding=10, fmt='%d')
-ax.bar_label(handles[1], padding=10, fmt='%d')
+ax.bar_label(handles[0], padding=10, fmt='%d', rotation='vertical')
+ax.bar_label(handles[1], padding=10, fmt='%d', rotation='vertical')
 
 # Write the plot out
 plt.tight_layout()
diff --git a/scripts/plot_runtimes.py b/scripts/plot_runtimes.py
index 99d96f2..46eb364 100644
--- a/scripts/plot_runtimes.py
+++ b/scripts/plot_runtimes.py
@@ -73,7 +73,7 @@ for ax in (ax3,):
     handles, labels = ax.get_legend_handles_labels()
 # Add the labels to both handles
 #    ax.set_xlabel('Number of code bytes in file')
-    ax.set_xlabel('Processing time')
+    ax.set_xlabel('Processing time in seconds')
     ax.set_ylabel('Library filename')
 #    ax.bar_label(handles[0], padding=20, fmt='%.2f')
 #    ax.bar_label(handles[1], padding=10, fmt='%.2f')
-- 
GitLab