bar plot
This commit is contained in:
+36
-9
@@ -118,18 +118,45 @@ def convert_score(data):
|
|||||||
|
|
||||||
# DATA[name] = {name: [scores]}
|
# DATA[name] = {name: [scores]}
|
||||||
def no_interface_plot(DATA):
|
def no_interface_plot(DATA):
|
||||||
|
n = 0
|
||||||
species = list(DATA.keys())
|
names_with = []#DATA.keys()
|
||||||
penguin_means = {
|
names_without = []
|
||||||
'Int': [],
|
|
||||||
'Not Int': []}
|
|
||||||
|
|
||||||
for creator, Data in DATA.items():
|
for creator, Data in DATA.items():
|
||||||
for tester, data in Data.items():
|
for tester, data in Data.items():
|
||||||
pass
|
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]}
|
||||||
|
|
||||||
fig, ax = plt.subplots()
|
x = np.arange(len(names_with)) # the label locations
|
||||||
print(DATA.keys())
|
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')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user