From e8dce77d0b5e1c36882d6233987fc34ac2ced4fe Mon Sep 17 00:00:00 2001 From: Georgy Evtushenko Date: Tue, 2 May 2023 00:19:42 +0400 Subject: [PATCH] Better hist --- benchmarks/scripts/analyze.py | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/benchmarks/scripts/analyze.py b/benchmarks/scripts/analyze.py index 0f76fb35d..dff5ad19c 100755 --- a/benchmarks/scripts/analyze.py +++ b/benchmarks/scripts/analyze.py @@ -195,19 +195,25 @@ def coverage(args): def case_variants(pattern, algname, ct_point_name, case_df): - print("{}[{}]:".format(algname, ct_point_name)) - mask = case_df['variant'].str.contains(pattern, regex=True) - # df = case_df[mask][['variant', 'speedup'] + get_rt_axes(case_df)] - - for _, row in case_df[mask].iterrows(): - data = {row['variant']: row['samples'], - 'base': row['base_samples']} - sns.displot(data) - description = algname + ' / ' + row['variant'] - for rt_axis in get_rt_axes(case_df): + title = "{}[{}]:".format(algname, ct_point_name) + df = case_df[case_df['variant'].str.contains(pattern, regex=True)].reset_index(drop=True) + num_rows = len(df) + + fig, axes = plt.subplots(nrows=num_rows, ncols=1, gridspec_kw = {'wspace': 0, 'hspace': 0}) + for id, row in df.iterrows(): + description = row['variant'] + for rt_axis in get_rt_axes(df): description += ' / ' + rt_axis + '=' + row[rt_axis] - plt.title(description) - plt.show() + data = {description: row['samples'], + 'base': row['base_samples']} + sns.histplot(data, ax=axes[id], kde=True) + + for ax in axes.flat: + ax.set_xticklabels([]) + + fig.suptitle(title) + plt.tight_layout() + plt.show()