From 052db363d726cf706dcdb241a0ed716b300fec80 Mon Sep 17 00:00:00 2001 From: gestures Date: Fri, 10 Jul 2026 15:54:49 +0300 Subject: [PATCH] bar plot --- fullplot_stats.py | 47 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/fullplot_stats.py b/fullplot_stats.py index ce91670..12f0052 100644 --- a/fullplot_stats.py +++ b/fullplot_stats.py @@ -118,18 +118,45 @@ def convert_score(data): # DATA[name] = {name: [scores]} def no_interface_plot(DATA): - - species = list(DATA.keys()) - penguin_means = { - 'Int': [], - 'Not Int': []} - + n = 0 + names_with = []#DATA.keys() + names_without = [] for creator, Data in DATA.items(): for tester, data in Data.items(): - pass - - fig, ax = plt.subplots() - print(DATA.keys()) + if tester == creator: + if 'NoInt' in creator: + pass + else: + names_with.append(creator) + names_without.append(creator+'NoInt') + #print(len(names_with), names_with) + #print(len(names_without), names_without) + ''' + for tester, data in Data.items(): + if tester == creator: + del DATA[] + ''' + penguin_means = { + 'With interface': [np.median(DATA[name][name]) for name in names_with], + 'Without interface': [np.median(DATA[name][name]) for name in names_without]} + + x = np.arange(len(names_with)) # the label locations + width = 0.25 # the width of the bars + multiplier = 0 + + fig, ax = plt.subplots(layout='constrained') + + for attribute, measurement in penguin_means.items(): + offset = width * multiplier + rects = ax.bar(x + offset, np.round(measurement,2), width, label=attribute) + ax.bar_label(rects, padding=3) + multiplier += 1 + ax.set_ylabel('Score') + ax.set_title('Change in scores with visual interface disabled') + ax.set_xticks(x + width, names_with) + ax.legend(loc='upper left', ncols=3) + ax.set_ylim(0, 100) + ax.grid(axis='y')