| |
| |
| |
|
|
| import matplotlib.pyplot as plt |
| import numpy as np |
|
|
| configs = [ |
| "Biomni\n(Baseline)", |
| "+MCP\nInfra.", |
| "+MCP Infra.\n +Graph-Sca\n Planning", |
| ] |
|
|
| |
| metrics = { |
| "BioAgentBench": [39.67, 42.68, 46.84], |
| "LAB-Bench DbQA": [57.46, 66.35, 67.29], |
| "LAB-Bench SeqQA": [84.76, 89.84, 90.48], |
| } |
|
|
| |
| |
| |
| fill_colors = [ |
| "#E5E7EB", |
| "#D6E4F0", |
| "#E8D6DC", |
| ] |
|
|
| edge_colors = [ |
| "#6B7280", |
| "#4B6A88", |
| "#8A3D5D", |
| ] |
|
|
| |
| |
| |
| plt.rcParams.update( |
| { |
| "font.family": "DejaVu Sans", |
| "font.size": 10, |
| "axes.titlesize": 12, |
| "xtick.labelsize": 9, |
| "ytick.labelsize": 9.5, |
| "pdf.fonttype": 42, |
| "ps.fonttype": 42, |
| } |
| ) |
|
|
| fig, axes = plt.subplots( |
| 1, |
| 3, |
| figsize=(8.4, 2.85), |
| sharey=True, |
| ) |
|
|
| y = np.arange(len(configs)) |
|
|
| for idx, (ax, (title, values)) in enumerate(zip(axes, metrics.items())): |
|
|
| values = np.array(values) |
| baseline = values[0] |
|
|
| span = values.max() - values.min() |
|
|
| x_min = values.min() - span * 0.28 - 0.6 |
| x_max = values.max() + span * 0.52 + 1.2 |
|
|
| ax.set_xlim(x_min, x_max) |
|
|
| |
| ax.axvline( |
| baseline, |
| color="#C7CCD4", |
| linestyle="--", |
| linewidth=0.9, |
| zorder=1, |
| ) |
|
|
| for i, val in enumerate(values): |
|
|
| |
| ax.barh( |
| y[i], |
| val - x_min, |
| left=x_min, |
| height=0.42, |
| color=fill_colors[i], |
| edgecolor=edge_colors[i], |
| linewidth=1.15, |
| zorder=3, |
| ) |
|
|
| |
| ax.barh( |
| y[i], |
| (val - x_min) * 0.52, |
| left=x_min, |
| height=0.42, |
| color="white", |
| alpha=0.12, |
| linewidth=0, |
| zorder=4, |
| ) |
|
|
| |
| ax.text( |
| val - span * 0.06, |
| y[i], |
| f"{val:.1f}", |
| ha="right", |
| va="center", |
| fontsize=10, |
| color=edge_colors[i], |
| fontweight="bold" if i == 2 else "normal", |
| ) |
|
|
| |
| if i > 0: |
| gain = val - baseline |
|
|
| ax.text( |
| val + span * 0.14 + 0.2, |
| y[i], |
| f"+{gain:.1f}", |
| ha="left", |
| va="center", |
| fontsize=8.8, |
| color="#16924A", |
| ) |
|
|
| |
| ax.set_title(title, pad=7, fontweight="bold") |
|
|
| ax.set_xticks([]) |
|
|
| |
| ax.spines["top"].set_visible(False) |
| ax.spines["right"].set_visible(False) |
| ax.spines["bottom"].set_visible(False) |
|
|
| ax.spines["left"].set_color("#D1D5DB") |
| ax.spines["left"].set_linewidth(0.8) |
|
|
| if idx == 0: |
| ax.set_yticks(y) |
| ax.set_yticklabels(configs) |
| else: |
| ax.tick_params(axis="y", left=False, labelleft=False) |
|
|
| |
| axes[0].invert_yaxis() |
|
|
| |
| |
| |
| fig.suptitle( |
| "Ablation of MCP Infrastructure and Graph Planning", |
| fontsize=13.5, |
| fontweight="bold", |
| y=1.02, |
| ) |
|
|
| |
| |
| |
| fig.subplots_adjust( |
| left=0.16, |
| right=0.985, |
| top=0.72, |
| bottom=0.15, |
| wspace=0.08, |
| ) |
|
|
| |
| |
| |
| fig.savefig("ablation_academic.pdf", bbox_inches="tight") |
| fig.savefig("ablation_academic.png", dpi=500, bbox_inches="tight") |
| fig.savefig("ablation_academic.svg", bbox_inches="tight") |