16
16
PLOTS = Path (ROOT / 'plots' )
17
17
18
18
def percent_formatter (x ):
19
- return f'{ round ( x ) } % '
19
+ return f'{ '{:.1%}' . format ( x / 100 ) } '
20
20
21
21
CORRECTNESS_PALETTE = {"LinkQ 0/3" : '#999999' , "LinkQ 1/3" : '#c8ddec' , "LinkQ 2/3" : '#72aad0' , "LinkQ 3/3" : '#1f78b4' , "GPT-4 0/3" : '#999999' , "GPT-4 1/3" : '#fff4e5' , "GPT-4 2/3" : '#ffdeb3' , "GPT-4 3/3" : '#fdbf6f' }
22
22
QUESTION_TYPE_ORDER = ['Comparative' , 'Yes/No' , 'Generic' , 'MultiHop' , "Intersection" ]
@@ -130,7 +130,7 @@ def correctness_stacked_barchart():
130
130
131
131
# Plot side-by-side stacked bars
132
132
fig , ax = plt .subplots ()
133
- fig .set_figwidth (7 )
133
+ fig .set_figwidth (8 )
134
134
for alg_idx , algorithm in enumerate (algorithms ):
135
135
# Filter data for the current algorithm
136
136
algorithm_data = df [df ['Algorithm' ] == algorithm ]
@@ -152,6 +152,8 @@ def correctness_stacked_barchart():
152
152
width = width ,
153
153
color = color ,
154
154
label = f'{ algorithm } { correct } ' ,
155
+ edgecolor = "black" ,
156
+ linewidth = 0.5 ,
155
157
bottom = bottom )
156
158
157
159
# for xpos, value, y in zip(plot_x, values, bottom):
@@ -163,7 +165,7 @@ def correctness_stacked_barchart():
163
165
164
166
# Label the percentage sums
165
167
for xpos , total in zip (plot_x , bottom ):
166
- ax .text (x = xpos , y = total + 0.5 , s = percent_formatter (total ), ha = 'center' , va = 'bottom' , fontsize = 11 )
168
+ ax .text (x = xpos , y = total + 0.5 , s = percent_formatter (total ), ha = 'center' , va = 'bottom' , fontsize = 9 )
167
169
168
170
ax .set_xlabel ('Question Type' )
169
171
ax .set_ylabel ('% Correct' )
0 commit comments