MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / draw_axes

Function draw_axes

experiments/human_eval/draw_model_eval_ggbench_labeled.py:154–173  ·  view source on GitHub ↗
(draw: ImageDraw.ImageDraw)

Source from the content-addressed store, hash-verified

152
153
154def draw_axes(draw: ImageDraw.ImageDraw) -> None:
155 draw.line((PLOT_L, PLOT_T, PLOT_L, PLOT_B), fill=AXIS, width=s(3))
156 draw.line((PLOT_L, PLOT_B, PLOT_R, PLOT_B), fill=AXIS, width=s(3))
157
158 for tick in [65, 70, 75, 80, 85, 90, 95, 100]:
159 y = y_pos(float(tick))
160 draw.line((PLOT_L - s(10), y, PLOT_L, y), fill=AXIS, width=s(3))
161 label = str(tick)
162 box = draw.textbbox((0, 0), label, font=F_TICK)
163 draw.text((PLOT_L - s(18) - (box[2] - box[0]), y - s(18)), label, font=F_TICK, fill=TEXT)
164
165 for tick in [63.5, 64.0, 64.5, 65.0]:
166 x = x_pos(tick)
167 draw.line((x, PLOT_B, x, PLOT_B + s(13)), fill=AXIS, width=s(3))
168 label = f"{tick:.1f}"
169 box = draw.textbbox((0, 0), label, font=F_TICK)
170 draw.text((x - (box[2] - box[0]) / 2, PLOT_B + s(24)), label, font=F_TICK, fill=TEXT)
171
172 draw.text((PLOT_L - s(48), PLOT_T - s(74)), "Human", font=F_AXIS, fill=TEXT)
173 draw.text((PLOT_R + s(45), PLOT_B - s(7)), "ModelAuto", font=F_AXIS, fill=TEXT)
174
175
176def draw_chart(rows: list[dict[str, object]]) -> Image.Image:

Callers 1

draw_chartFunction · 0.85

Calls 3

sFunction · 0.85
y_posFunction · 0.70
x_posFunction · 0.70

Tested by

no test coverage detected