{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 777,
   "id": "f986ff13",
   "metadata": {},
   "outputs": [],
   "source": [
    "import seaborn as sns\n",
    "import csv\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "import matplotlib as mpl\n",
    "from scipy.stats import pearsonr\n",
    "mpl.rcParams['figure.dpi']= 300\n",
    "\n",
    "from matplotlib.patches import Ellipse\n",
    "from scipy.spatial import ConvexHull\n",
    "\n",
    "col = {\n",
    "    \"red\": \"#FF4242\",\n",
    "    \"blue\": \"#0d21a1\",\n",
    "    \"bean\": \"#2b0d11\",\n",
    "    \"indigo\": \"#9b7ede\",\n",
    "}\n",
    "col_key = {\n",
    "    \"Design\": col[\"blue\"],\n",
    "    \"Implementation\": col[\"red\"],\n",
    "    \"Documentation\": col[\"bean\"],\n",
    "    \"Maintenance\": col[\"indigo\"],\n",
    "    \"FM\": \"#255957\",\n",
    "    \"nonFM\": \"#FFBA08\",\n",
    "}\n",
    "FONT_TICK = 16\n",
    "FONT_LAB = FONT_TICK\n",
    "FONT_IN_PLOT = 12\n",
    "N_FM_CUT = 15 # Number of foundation models\n",
    "SAVE_PLOTS = True\n",
    "\n",
    "# Use ablated data file or not. Flag is necessary for plotting/calculation difference (csv number of rows etc.)\n",
    "if True:\n",
    "    IS_ABLATION = False\n",
    "    FILE = '/path_to_results/bb_final_3pm.csv'\n",
    "else:\n",
    "    IS_ABLATION = True\n",
    "    FILE = '/path_to_results/bb_final_3pm_ablated.csv'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 778,
   "id": "c7604b9f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 142588 characters]",
      "text/plain": [
       "<Figure size 3000x1500 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Create a figure and axes\n",
    "fig, ax = plt.subplots(figsize=(10, 5))\n",
    "\n",
    "# Set the x-positions for each box plot\n",
    "positions = list(col_key.keys())[:-2]\n",
    "\n",
    "inds = [41, 42, 43, 44]\n",
    "if IS_ABLATION:\n",
    "    inds = [39, 40, 41, 42]\n",
    "for i_i, i in enumerate(inds):\n",
    "    df = pd.read_csv(FILE)\n",
    "    arr = df.iloc[i].to_numpy()[1:-2]\n",
    "    lab, dat = arr[0][:-6], arr[1:].astype(np.float64)\n",
    "    \n",
    "    # Create a DataFrame from the array\n",
    "    df = pd.DataFrame({'data': dat, 'pos': [positions[i_i]] * dat.shape[0]})\n",
    "    \n",
    "    # Create box plots with individual data points\n",
    "    a = 0.9\n",
    "    if i_i == 2:\n",
    "        a = 0.7\n",
    "    sns.boxplot(data=df, y='data', x='pos', color=col_key[lab], ax=ax, boxprops=dict(alpha=a))\n",
    "    sns.stripplot(data=df, y='data', x='pos', color='black', ax=ax, size=4, jitter=True)\n",
    "\n",
    "# Set the y-ticks and labels\n",
    "y_ticks = [-0.05, 5, 10, 15.05]\n",
    "y_ticks_pure = [0, 5, 10, 15]\n",
    "ax.set_yticks(y_ticks)\n",
    "ax.set_yticklabels(y_ticks_pure, fontsize=FONT_TICK)\n",
    "\n",
    "\n",
    "# Set the x-tick labels\n",
    "ax.set_xticks(positions)\n",
    "ax.set_xticklabels(positions, fontsize=FONT_TICK)\n",
    "\n",
    "# Add labels and title\n",
    "# ax.set_xlabel('Benchmark Lifecycle Stage', fontsize=FONT_LAB)\n",
    "ax.set_xlabel(None, fontsize=FONT_LAB)\n",
    "ax.set_ylabel('Average Score [a.u.]', fontsize=FONT_LAB)\n",
    "ax.set_ylim([-0.1, 15.1])\n",
    "\n",
    "# Adjust the layout\n",
    "plt.tight_layout()\n",
    "\n",
    "# Show the plot\n",
    "if SAVE_PLOTS:\n",
    "    plt.savefig(\"bbench_boxplot_overview.pdf\", dpi=300)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 779,
   "id": "e6456e97",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 212772 characters]",
      "text/plain": [
       "<Figure size 1800x1800 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Create a figure and axes\n",
    "fig, ax = plt.subplots(figsize=(6, 6))\n",
    "\n",
    "# Set the x-positions for each box plot\n",
    "positions = list(col_key.keys())[:-2]\n",
    "\n",
    "inds = [41, 42, 43, 44]\n",
    "if IS_ABLATION:\n",
    "    inds = [39, 40, 41, 42]\n",
    "for i_i, i in enumerate(inds):\n",
    "    df = pd.read_csv(FILE)\n",
    "    arr = df.iloc[i].to_numpy()[1:-2]\n",
    "    lab, dat = arr[0][:-6], arr[1:].astype(np.float64)\n",
    "    \n",
    "    df = pd.DataFrame({'data': dat, 'pos': [i_i] * dat.shape[0]})\n",
    "    \n",
    "    # Create box plots with individual data points\n",
    "    a = 0.9\n",
    "    if i_i == 2 or i_i == 0:\n",
    "        a = 0.7\n",
    "    sns.stripplot(data=df, y='data', x='pos', color='black', ax=ax, size=5, jitter=True)\n",
    "    sns.boxplot(data=df, y='data', x='pos', color=col_key[lab], ax=ax, boxprops=dict(alpha=a), width=0.6, linewidth=2.)\n",
    "\n",
    "\n",
    "# Set ticks and labels\n",
    "y_ticks = [-0.05, 5, 10, 15.05]\n",
    "y_ticks_pure = [0, 5, 10, 15]\n",
    "ax.set_yticks(y_ticks)\n",
    "ax.set_yticklabels(y_ticks_pure, fontsize=FONT_TICK)\n",
    "ax.set_xticks([0., 1., 2., 3.])\n",
    "ax.set_xticklabels(positions, fontsize=FONT_TICK)\n",
    "\n",
    "# Add labels and title\n",
    "# ax.set_xlabel('Benchmark Lifecycle Stage', fontsize=FONT_LAB)\n",
    "ax.set_xlabel(None, fontsize=FONT_LAB)\n",
    "ax.set_ylabel('Average Score [a.u.]', fontsize=FONT_LAB)\n",
    "ax.set_xlim([-0.5, 3.5])\n",
    "ax.set_ylim([-0.1, 15.1])\n",
    "\n",
    "# Adjust the layout\n",
    "plt.xticks(rotation=45, ha='right')\n",
    "plt.tight_layout()\n",
    "\n",
    "# Show the plot\n",
    "if SAVE_PLOTS:\n",
    "    plt.savefig(\"bbench_boxplot_overview_comp.pdf\", dpi=300)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 781,
   "id": "9b3f12f3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 459240 characters]",
      "text/plain": [
       "<Figure size 3000x1500 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "[encoded data, 208696 characters]",
      "text/plain": [
       "<Figure size 3000x1500 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.6752824508760551 0.004097756147769993\n",
      "Significant.\n",
      "0.5737234564788681 0.10625397234641591\n",
      "Not significant.\n",
      "0.5684624947630605 0.003028270749585587\n",
      "Significant.\n"
     ]
    }
   ],
   "source": [
    "fig, ax = plt.subplots(figsize=(10, 5))\n",
    "\n",
    "# Handle data\n",
    "data = []\n",
    "df = pd.read_csv(FILE)\n",
    "arr = df.iloc[45].to_numpy()[1:-2]\n",
    "if IS_ABLATION:\n",
    "    arr = df.iloc[43].to_numpy()[1:-2]\n",
    "lab0, dat0 = arr[0][:-6], arr[1:].astype(np.float64)\n",
    "bench_names = df.keys().to_numpy()[2:-2]\n",
    "\n",
    "df = pd.read_csv(FILE)\n",
    "arr = df.iloc[46].to_numpy()[1:-2]\n",
    "if IS_ABLATION:\n",
    "    arr = df.iloc[44].to_numpy()[1:-2]\n",
    "lab1, dat1 = arr[0][:-6], arr[1:].astype(np.float64)\n",
    "for name, x, y in zip(bench_names, dat0, dat1):\n",
    "    data.append({\"Name\": name, \"X\": x, \"Y\": y})\n",
    "df_scatter = pd.DataFrame(data)\n",
    "\n",
    "# Create the scatter plot\n",
    "palette = [col_key[\"FM\"]] * N_FM_CUT + [col_key[\"nonFM\"]] * (len(df_scatter) - N_FM_CUT)\n",
    "sns.scatterplot(data=df_scatter, x=\"X\", y=\"Y\", hue=\"Name\", palette=palette, s=100, legend=False)\n",
    "ax.scatter([-4.], [-4.], color=col_key[\"FM\"], s=100, label=\"Foundation Model\")\n",
    "ax.scatter([-4.], [-4.], color=col_key[\"nonFM\"], s=100, label=\"Non-Foundation Model\")\n",
    "\n",
    "# Define manual positions for labels of benchmarks to avoid overlap of labels in visualization\n",
    "manual_positions = [\n",
    "    (12.5, 6), # 0                                     BBQ\n",
    "    (14, 5), # 1                              TruthfulQA\n",
    "    (7.5, 3.5), # 2                                    BOLD\n",
    "    (5., 3.), # 3                                    MMLU\n",
    "    (14., 1.), # 4                           ARC Challenge\n",
    "    (9.5, 13.5), # 5                              WinoGrande\n",
    "    (16., 6.5), # 6                         Codex HumanEval\n",
    "    (11.5, 4.), # 7                                   GSM8k\n",
    "    (4.5, 5.5), # 8                               HellaSwag\n",
    "    (18., 12.), # 9                             Machiavelli\n",
    "    (18.2, 9.7), # 10                             AgentBench\n",
    "    (17., 8.), # 11               MLCommons AI Safety v0.5\n",
    "    (10., 4.), # 12                                   MMMU\n",
    "    (11.5, 10.8), # 13                                   GPQA\n",
    "    (5.5, 8.5), # 14                              BIG-bench\n",
    "    (12.5, 17.), # 15                          DecodingTrust\n",
    "    (6., 10.), # 16                                Procgen\n",
    "    (11., 15.), # 17                            MedMNIST v2\n",
    "    (8.2, 6.2), # 18                              Wordcraft\n",
    "    (14.75, 13.5), # 19                           RL Unplugged\n",
    "    (7.5, 14.5), # 20                             FinRL-Meta\n",
    "    (18., 11.), # 21                              SafeBench\n",
    "    (17.6, 14.), # 22                               PDEBench\n",
    "    (14., 15.5), # 23    Arcade Learning Environment (Atari)\n",
    "    (6.5, 13.), # 24                                 MuJoCo\n",
    "]\n",
    "\n",
    "# List to store annotations\n",
    "labels = []\n",
    "\n",
    "for i, row in df_scatter.iterrows():\n",
    "    if i < len(manual_positions):\n",
    "        text_pos = manual_positions[i]\n",
    "    else:\n",
    "        # Calculate the vector from the center of mass\n",
    "        vector = row[['X', 'Y']].values - center_of_mass\n",
    "        # Normalize the vector\n",
    "        norm_vector = vector / np.linalg.norm(vector)\n",
    "        text_pos = (row[\"X\"] + norm_vector[0] * 3.5, row[\"Y\"] + norm_vector[1] * 3.5)\n",
    "    # Add the text label to the plot\n",
    "    label = ax.text(text_pos[0], text_pos[1], row[\"Name\"], fontsize=FONT_IN_PLOT, ha='center', va='center')\n",
    "    labels.append(label)\n",
    "    \n",
    "    arrow_length_factor = 0.8  # Hot-fix factor to shorten arrow\n",
    "    arrow_end = (\n",
    "        text_pos[0] * arrow_length_factor + row[\"X\"] * (1 - arrow_length_factor),\n",
    "        text_pos[1] * arrow_length_factor + row[\"Y\"] * (1 - arrow_length_factor)\n",
    "    )\n",
    "    arrow = FancyArrowPatch((row[\"X\"], row[\"Y\"]), arrow_end, arrowstyle=\"->\", color=palette[i], lw=0.9)\n",
    "    ax.add_patch(arrow)\n",
    "\n",
    "# Set the plot title and labels\n",
    "ax.set_xlabel(lab0 + \" Score [a.u.]\", fontsize=FONT_LAB)\n",
    "ax.set_ylabel(lab1 + \" Score [a.u.]\", fontsize=FONT_LAB)\n",
    "ax.set_xticks([0, 5, 10, 15])\n",
    "ax.set_xticklabels([0, 5, 10, 15], fontsize=FONT_TICK)\n",
    "ax.set_yticks([0, 5, 10, 15])\n",
    "ax.set_yticklabels([0, 5, 10, 15], fontsize=FONT_TICK)\n",
    "ax.set_xlim([-0., 20.])\n",
    "ax.set_ylim([-0., 18.])\n",
    "ax.legend(loc=\"upper left\")\n",
    "\n",
    "# Show the plot\n",
    "plt.tight_layout()\n",
    "if SAVE_PLOTS:\n",
    "    plt.savefig(\"bbench_scatter_plot.pdf\", dpi=300)\n",
    "plt.show()\n",
    "\n",
    "if True:\n",
    "    fig, ax = plt.subplots(figsize=(10, 5))\n",
    "    d0 = np.transpose([dat0, dat1])[:N_FM_CUT + 1]\n",
    "    d1 = np.transpose([dat0, dat1])[N_FM_CUT + 1:]\n",
    "    np.random.seed(2024)\n",
    "\n",
    "    n_bootstrap_samples = 50000\n",
    "\n",
    "    # Bootstrap resampling\n",
    "    bootstrap_means = np.zeros((n_bootstrap_samples, 2))\n",
    "    for i in range(n_bootstrap_samples):\n",
    "        bootstrap_sample0 = np.random.choice(len(d0), size=len(d0), replace=True)\n",
    "        bootstrap_sample1 = np.random.choice(len(d1), size=len(d1), replace=True)\n",
    "        m0 = np.mean(d0[bootstrap_sample0], axis=0)\n",
    "        m1 = np.mean(d1[bootstrap_sample1], axis=0)\n",
    "        bootstrap_means[i] = m0 - m1\n",
    "\n",
    "    # Calculate the mean and covariance\n",
    "    mean = np.mean(bootstrap_means, axis=0)\n",
    "    cov = np.cov(bootstrap_means, rowvar=False)\n",
    "    inv_cov = np.linalg.inv(cov)\n",
    "\n",
    "    # Calculate Mahalanobis distance\n",
    "    mahalanobis_distances = np.array([np.sqrt((mean_diff @ inv_cov @ mean_diff.T)) for mean_diff in (bootstrap_means - mean)])\n",
    "\n",
    "    # Determine 95% confidence region\n",
    "    cutoff = np.percentile(mahalanobis_distances, 95)\n",
    "    confidence_region_points = bootstrap_means[mahalanobis_distances <= cutoff]\n",
    "    hull = ConvexHull(confidence_region_points)\n",
    "\n",
    "    # Plot 95% confidence region\n",
    "    hull_points = confidence_region_points[hull.vertices]\n",
    "    ax.scatter((d0.mean(axis=0) - d1.mean(axis=0))[0], (d0.mean(axis=0) - d1.mean(axis=0))[1], color=col_key[\"FM\"], label=\"Mean(FM) - Mean(Non-FM)\")\n",
    "    ax.plot(np.append(hull_points[:, 0], hull_points[0, 0]), np.append(hull_points[:, 1], hull_points[0, 1]), color=col_key[\"FM\"], lw=2, label='95% Confidence Region')\n",
    "    ax.fill(np.append(hull_points[:, 0], hull_points[0, 0]), np.append(hull_points[:, 1], hull_points[0, 1]), color=col_key[\"FM\"], lw=2, label=None, alpha=0.3)\n",
    "\n",
    "    ax.plot([0., 0], [-10., 10.], \"k--\", alpha=0.5)\n",
    "    ax.plot([-10., 10.], [0., 0], \"k--\", alpha=0.5)\n",
    "\n",
    "    # Set the plot title and labels\n",
    "    ax.set_xlabel(lab0 + \" Score Difference [a.u.]\", fontsize=FONT_LAB)\n",
    "    ax.set_ylabel(lab1 + \" Score Difference [a.u.]\", fontsize=FONT_LAB)\n",
    "    ax.set_xticks([-5., -2.5, 0., 2.5, 5.])\n",
    "    ax.set_xticklabels([-5., -2.5, 0., 2.5, 5.], fontsize=FONT_TICK)\n",
    "    ax.set_yticks([-5., -2.5, 0., 2.5, 5.])\n",
    "    ax.set_yticklabels([-5., -2.5, 0., 2.5, 5.], fontsize=FONT_TICK)\n",
    "    ax.set_xlim([-5., 5.])\n",
    "    ax.set_ylim([-5., 5.])\n",
    "    ax.legend()\n",
    "    \n",
    "    if SAVE_PLOTS:\n",
    "        plt.savefig(\"bbench_scatter_meandiff.pdf\", dpi=300)\n",
    "    plt.show()\n",
    "    \n",
    "    \n",
    "if True:\n",
    "    # Calculate pearson correlation coefficient for p = 0.05\n",
    "    for d in [np.transpose([dat0, dat1])[:N_FM_CUT + 1].T, np.transpose([dat0, dat1])[N_FM_CUT + 1:].T, np.transpose([dat0, dat1]).T]:\n",
    "        correlation, p_value = pearsonr(d[0], d[1])\n",
    "        print(correlation, p_value)\n",
    "        alpha = 0.05\n",
    "        if p_value < alpha:\n",
    "            print(\"Significant.\")\n",
    "        else:\n",
    "            print(\"Not significant.\")\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 782,
   "id": "a08c4c16",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/var/folders/2k/4vqb4r1d6s1gj0bfrcw93pph0000gn/T/ipykernel_63737/3206922810.py:21: FutureWarning: \n",
      "\n",
      "Passing `palette` without assigning `hue` is deprecated and will be removed in v0.14.0. Assign the `x` variable to `hue` and set `legend=False` for the same effect.\n",
      "\n",
      "  sns.barplot(df, x=\"benchmark\", y=\"data\", palette=list(palette[sort_ind]))\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 633216 characters]",
      "text/plain": [
       "<Figure size 3000x1500 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/var/folders/2k/4vqb4r1d6s1gj0bfrcw93pph0000gn/T/ipykernel_63737/3206922810.py:21: FutureWarning: \n",
      "\n",
      "Passing `palette` without assigning `hue` is deprecated and will be removed in v0.14.0. Assign the `x` variable to `hue` and set `legend=False` for the same effect.\n",
      "\n",
      "  sns.barplot(df, x=\"benchmark\", y=\"data\", palette=list(palette[sort_ind]))\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 488120 characters]",
      "text/plain": [
       "<Figure size 3000x1500 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/var/folders/2k/4vqb4r1d6s1gj0bfrcw93pph0000gn/T/ipykernel_63737/3206922810.py:21: FutureWarning: \n",
      "\n",
      "Passing `palette` without assigning `hue` is deprecated and will be removed in v0.14.0. Assign the `x` variable to `hue` and set `legend=False` for the same effect.\n",
      "\n",
      "  sns.barplot(df, x=\"benchmark\", y=\"data\", palette=list(palette[sort_ind]))\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 646528 characters]",
      "text/plain": [
       "<Figure size 3000x1500 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/var/folders/2k/4vqb4r1d6s1gj0bfrcw93pph0000gn/T/ipykernel_63737/3206922810.py:21: FutureWarning: \n",
      "\n",
      "Passing `palette` without assigning `hue` is deprecated and will be removed in v0.14.0. Assign the `x` variable to `hue` and set `legend=False` for the same effect.\n",
      "\n",
      "  sns.barplot(df, x=\"benchmark\", y=\"data\", palette=list(palette[sort_ind]))\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 581608 characters]",
      "text/plain": [
       "<Figure size 3000x1500 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Set the x-positions for each box plot\n",
    "stages = list(col_key.keys())[:-2]\n",
    "tar_i = [41, 42, 43, 44]\n",
    "if IS_ABLATION:\n",
    "    tar_i = [39, 40, 41, 42]\n",
    "\n",
    "for stage_i, stage in enumerate(stages):\n",
    "    i = tar_i[stage_i]\n",
    "    df = pd.read_csv(FILE)\n",
    "    bench_names = df.keys().to_numpy()[2:-2]\n",
    "    arr = df.iloc[i].to_numpy()[1:-2]\n",
    "    lab, dat = arr[0][:-6], arr[1:].astype(np.float64)\n",
    "    sort_ind = np.argsort(dat)\n",
    "    \n",
    "    df = pd.DataFrame({'data': dat[sort_ind], \"benchmark\": bench_names[sort_ind]})\n",
    "    palette = np.array([col_key[\"FM\"]] * N_FM_CUT + [col_key[\"nonFM\"]] * (len(df) - N_FM_CUT))\n",
    "    fig, ax = plt.subplots(figsize=(10, 5))\n",
    "    \n",
    "    ax.scatter([-4.], [-4.], color=col_key[\"FM\"], s=100, label=\"Foundation Model\")\n",
    "    ax.scatter([-4.], [-4.], color=col_key[\"nonFM\"], s=100, label=\"Non-Foundation Model\")\n",
    "    sns.barplot(df, x=\"benchmark\", y=\"data\", palette=list(palette[sort_ind]))\n",
    "    \n",
    "    ax.set_xticks(bench_names[sort_ind])\n",
    "    ax.set_xticklabels(bench_names[sort_ind], fontsize=FONT_TICK, color=col_key[lab])\n",
    "    plt.xticks(rotation=45, ha='right')\n",
    "    y_ticks = [-0.05, 5, 10, 15.05]\n",
    "    y_ticks_pure = [0, 5, 10, 15]\n",
    "    ax.set_yticks(y_ticks)\n",
    "    ax.set_yticklabels(y_ticks_pure, fontsize=FONT_TICK, color=col_key[lab])\n",
    "    ax.legend(loc=\"upper left\")\n",
    "\n",
    "    ax.set_xlabel(None, fontsize=FONT_LAB)\n",
    "    ax.set_ylabel(f'{lab}', fontsize=FONT_LAB, color=col_key[lab])\n",
    "    ax.set_ylim([-0.1, 15.1])\n",
    "\n",
    "    plt.tight_layout()\n",
    "    if SAVE_PLOTS:\n",
    "        plt.savefig(f\"bbench_barplot_{lab}.pdf\", dpi=300)\n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a6e34d48",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
