bar plot
This commit is contained in:
+35
-8
@@ -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():
|
||||
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()
|
||||
print(DATA.keys())
|
||||
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')
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user