@@ -126,10 +126,11 @@ def correctness_stacked_barchart():
126
126
x = np .arange (len (question_types )) # X-axis positions for question_types
127
127
algorithms = ['LinkQ' , 'GPT-4' ] # this list determines left to right ordering of the algorithms
128
128
correctness = ['3/3' ,'2/3' ,'1/3' ] # this list determines bottom to top stacking order of correctness
129
- width = 0.35 # Width of the bar
129
+ width = 0.38 # Width of the bar
130
130
131
131
# Plot side-by-side stacked bars
132
132
fig , ax = plt .subplots ()
133
+ fig .set_figwidth (7 )
133
134
for alg_idx , algorithm in enumerate (algorithms ):
134
135
# Filter data for the current algorithm
135
136
algorithm_data = df [df ['Algorithm' ] == algorithm ]
@@ -162,14 +163,15 @@ def correctness_stacked_barchart():
162
163
163
164
# Label the percentage sums
164
165
for xpos , total in zip (plot_x , bottom ):
165
- ax .text (x = xpos , y = total + 0.5 , s = percent_formatter (total ), ha = 'center' , va = 'bottom' , fontsize = 10 )
166
+ ax .text (x = xpos , y = total + 0.5 , s = percent_formatter (total ), ha = 'center' , va = 'bottom' , fontsize = 11 )
166
167
167
168
ax .set_xlabel ('Question Type' )
168
169
ax .set_ylabel ('% Correct' )
169
170
# ax.set_title('Side-by-Side Stacked Bar Chart')
170
171
ax .set_xticks (x )
171
172
ax .set_xticklabels (question_types )
172
173
ax .legend (title = "# Correct / 3 Attempts" , title_fontsize = 10 , bbox_to_anchor = (1 , 1 ), loc = 'upper left' )
174
+ plt .grid (axis = 'x' , which = 'both' , visible = False )
173
175
plt .tight_layout ()
174
176
plt .savefig (Path (PLOTS , 'correctness_stacked.pdf' ), bbox_inches = 'tight' , format = 'pdf' )
175
177
plt .close ()
0 commit comments