Skip to content

Commit

Permalink
Updated graphs.ipynb to the ACM format
Browse files Browse the repository at this point in the history
  • Loading branch information
marcocosta97 committed Aug 25, 2024
1 parent 0088742 commit ad88ecd
Showing 1 changed file with 18 additions and 24 deletions.
42 changes: 18 additions & 24 deletions bench/scripts/graphs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@
},
"outputs": [],
"source": [
"width = 7.16808\n",
"width = 5.47807\n",
"width_small = 3.50069\n",
"max_height = 9.77885\n",
"max_height = 7.944\n",
"\n",
"rc_fonts = {\n",
" \"font.family\": \"serif\",\n",
" \"font.size\": 9.5,\n",
" \"font.size\": 10,\n",
" \"text.usetex\": True,\n",
" 'text.latex.preamble': r'\\usepackage{mathpazo}'}\n",
" \"text.latex.preamble\": r\"\\usepackage[tt=false,type1=true]{libertine}\\usepackage[varqu]{zi4}\\usepackage[libertine]{newtxmath}\"}\n",
"matplotlib.rcParams.update(rc_fonts)\n",
"\n",
"out_folder = Path('./figures')\n",
Expand All @@ -67,7 +67,6 @@
" \"error, cannot find the results folder\")\n",
"\n",
"range_filters = ['Grafite', 'Bucketing', 'SNARF', 'SuRF', 'Proteus', 'Rosetta', 'REncoder', 'REncoder_SS', 'REncoder_SE']\n",
"# range_filters = ['Grafite', 'REncoder', 'REncoder_SE', 'REncoder_SS']\n",
"range_filters_style_kwargs = {'Grafite': {'marker': 'o', 'color': 'dimgray', 'zorder': 10, 'label': 'Grafite'},\n",
" 'SNARF': {'marker': '^', 'color': 'C1', 'label': 'SNARF'},\n",
" 'SuRF': {'marker': 's', 'color': 'C2', 'label': 'SuRF'},\n",
Expand All @@ -77,11 +76,6 @@
" 'REncoder_SS': {'marker': 'v', 'color': 'C6', 'label': 'REncoderSS'},\n",
" 'REncoder_SE': {'marker': 'h', 'color': 'C8', 'label': 'REncoderSE'},\n",
" 'Bucketing': {'marker': '*', 'color': 'C0', 'zorder': 9, 'label': 'Bucketing'}}\n",
"# range_filters_style_kwargs = {'Grafite': {'marker': 'o', 'color': 'dimgray'},\n",
"# 'REncoder_SE': {'marker': '^', 'color': 'C1'},\n",
"# 'REncoder_SS': {'marker': 'v', 'color': 'C5'},\n",
"# 'REncoder': {'marker': 'X', 'color': 'C3'},\n",
"# 'Bucketing': {'marker': 'p', 'color': 'C0'}}\n",
"\n",
"range_filters_cmaps = {'Grafite': {'cmap': cm.Greys}, \n",
" 'SNARF': {'cmap': cm.Oranges},\n",
Expand All @@ -106,7 +100,7 @@
"\n",
"keys_real = ['books', 'osm', 'fb']\n",
"query_range = [0, 5, 10]\n",
"query_range_label = [f\"Point queries\", \"Small range queries\", \"Large range queries\", \"Mixed range queries\"]\n",
"query_range_label = [f\"Point queries\", \"Small range\", \"Large range\", \"Mixed range\"]\n",
"\n",
"datasets_synth = list(itertools.product(keys_synth, query_synth))\n",
"datasets_real = keys_real\n",
Expand All @@ -122,10 +116,10 @@
" raise FileNotFoundError(f'error, {p} does not exist')\n",
" return p\n",
"\n",
"title_font_size = 9.5\n",
"legend_font_size = 7\n",
"ylabel_font_size = 9.5\n",
"xlabel_font_size = 9.5\n",
"title_font_size = 10\n",
"legend_font_size = 7.5\n",
"ylabel_font_size = 10\n",
"xlabel_font_size = 10\n",
"\n",
"max_x_axis_bpk = 30"
]
Expand Down Expand Up @@ -180,7 +174,7 @@
"def print_fpr_test(filters, workloads, name):\n",
" nrows = len(workloads)\n",
" ncols = len(query_range)\n",
" fig, axes = plt.subplots(nrows=nrows, ncols=ncols, sharex=True, sharey='row', figsize=(width * 0.7, max_height/1.6))\n",
" fig, axes = plt.subplots(nrows=nrows, ncols=ncols, sharex=True, sharey='row', figsize=(width * 0.8, max_height/1.4))\n",
"\n",
" iterate = list(itertools.product(workloads, filters, enumerate(query_range)))\n",
"\n",
Expand Down Expand Up @@ -226,10 +220,10 @@
"\n",
" if len(filters) > 4:\n",
" ncol = len(filters) // 2\n",
" bbox = (0.5, 1.6)\n",
" bbox = (0.5, 1.65)\n",
" else:\n",
" ncol = len(filters)\n",
" bbox = (0.5, 1.45)\n",
" bbox = (0.5, 1.5)\n",
" \n",
" axes[0][1].legend(lines, labels, loc='upper center', bbox_to_anchor=bbox,\n",
" fancybox=True, shadow=False, ncol=ncol, fontsize=legend_font_size)\n",
Expand Down Expand Up @@ -375,7 +369,7 @@
"old_range_filters = range_filters\n",
"range_filters = ['Grafite', 'Bucketing', 'SNARF', 'SuRF', 'Proteus', 'Rosetta', 'REncoder']\n",
"\n",
"fig, ax = plt.subplots(figsize=(width_small * 0.78, 0.3 * width))\n",
"fig, ax = plt.subplots(figsize=(width_small * 0.78, 0.4 * width))\n",
"\n",
"width_bars = 0.12 # the width of the bars\n",
"multiplier = 0\n",
Expand Down Expand Up @@ -445,7 +439,7 @@
"keys_synth = ['kuniform']\n",
"nrows = len(keys_synth)\n",
"ncols = len(query_range)\n",
"fig, axes = plt.subplots(nrows=nrows, ncols=ncols, sharex=True, sharey='row', figsize=(width * 0.9, 0.2 * width))\n",
"fig, axes = plt.subplots(nrows=nrows, ncols=ncols, sharex=True, sharey='row', figsize=(width * 0.8, 0.2 * width))\n",
"\n",
"iterate = list(itertools.product(range_filters, enumerate(query_range)))\n",
"\n",
Expand Down Expand Up @@ -518,7 +512,7 @@
"outputs": [],
"source": [
"# Figure 3: Correlation\n",
"fig, axes = plt.subplots(2, 3, sharex=True, sharey='row', figsize=(width, 0.45 * width))\n",
"fig, axes = plt.subplots(2, 3, sharex=True, sharey='row', figsize=(width, 0.6 * width))\n",
"\n",
"range_filters_corr = ['Grafite', 'Bucketing', 'SNARF', 'SuRF', 'Proteus', 'Rosetta', 'REncoder', 'REncoder_SS', 'REncoder_SE']\n",
"\n",
Expand Down Expand Up @@ -602,7 +596,7 @@
"range_filters_corr = ['Grafite', 'SNARF', 'SuRF', 'Proteus', 'Rosetta', 'REncoder']\n",
"\n",
"\n",
"fig, axes = plt.subplots(1, 2, sharex=True, figsize=(width_small, 0.2 * width))\n",
"fig, axes = plt.subplots(1, 2, sharex=True, figsize=(width_small * 1.2, 0.3 * width))\n",
"query_range_small = [5]\n",
"\n",
"iterate = list(itertools.product(range_filters_corr, enumerate(query_range_small), corr_degrees))\n",
Expand Down Expand Up @@ -645,7 +639,7 @@
"lines, labels = axes[0].get_legend_handles_labels()\n",
"lines2, labels2 = axes[1].get_legend_handles_labels()\n",
"axes[1].xaxis.set_major_formatter(matplotlib.ticker.FormatStrFormatter('%g'))\n",
"axes[1].legend(lines, labels, loc='upper center', bbox_to_anchor=(-0.3, -0.4),\n",
"axes[1].legend(lines, labels, loc='upper center', bbox_to_anchor=(-0.3, -0.35),\n",
" fancybox=True, shadow=False, ncol=3, columnspacing=0.5, fontsize=legend_font_size)\n",
"axes[0].set_ylabel('False Positive Rate', fontsize=ylabel_font_size)\n",
"axes[0].yaxis.set_minor_locator(matplotlib.ticker.LogLocator(numticks=10, subs='auto'))\n",
Expand Down Expand Up @@ -673,7 +667,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
"version": "3.11.9"
},
"orig_nbformat": 4,
"vscode": {
Expand Down

0 comments on commit ad88ecd

Please sign in to comment.