|
9 | 9 | parser.add_argument("-r", "--oracle", action="store_true") |
10 | 10 | args = parser.parse_args() |
11 | 11 |
|
| 12 | +# from https://matplotlib.org/stable/gallery/lines_bars_and_markers/linestyles.html |
| 13 | +linestyle_tuple = [ |
| 14 | + ("solid", "solid"), |
| 15 | + ("dashed", "dashed"), |
| 16 | + ("dashdot", "dashdot"), |
| 17 | + ("densely dotted", (0, (1, 1))), |
| 18 | + ("long dash with offset", (5, (10, 3))), |
| 19 | + ("densely dashdotdotted", (0, (3, 1, 1, 1, 1, 1))), |
| 20 | + ("densely dashdotted", (0, (3, 1, 1, 1))), |
| 21 | + ("dashdotted", (0, (3, 5, 1, 5))), |
| 22 | + ("densely dashed", (0, (5, 1))), |
| 23 | + ("loosely dashed", (0, (5, 10))), |
| 24 | + ("loosely dashdotted", (0, (3, 10, 1, 10))), |
| 25 | + ("dashdotdotted", (0, (3, 5, 1, 5, 1, 5))), |
| 26 | + ("loosely dashdotdotted", (0, (3, 10, 1, 10, 1, 10))), |
| 27 | + ("dotted", "dotted"), |
| 28 | + ("loosely dotted", (0, (1, 10))), |
| 29 | +] |
| 30 | + |
12 | 31 |
|
13 | 32 | runs = ["random", "bm25", "samenoun", "left", "right", "neighbors"] |
14 | 33 |
|
|
17 | 36 |
|
18 | 37 |
|
19 | 38 | plt.style.use("science") |
20 | | -# plt.rcParams.update({"xtick.labelsize": 18}) |
21 | | -# plt.rcParams.update({"ytick.labelsize": 18}) |
22 | 39 | plt.rc("xtick", labelsize=40) # fontsize of the tick labels |
23 | 40 | plt.rc("ytick", labelsize=40) # fontsize of the tick labels |
24 | 41 | fig, ax = plt.subplots() |
25 | 42 |
|
26 | | -fig.set_size_inches(16, 8) |
| 43 | +fig.set_size_inches(16, 12) |
27 | 44 |
|
28 | | -for run in runs: |
| 45 | +for run_i, run in enumerate(runs): |
29 | 46 | if args.oracle: |
30 | 47 | run = f"oracle_{run}" |
31 | 48 | with open(f"./runs/short/{run}/metrics.json") as f: |
32 | 49 | metrics = json.load(f) |
33 | 50 | ax.plot( |
34 | 51 | [int(step) for step in metrics["mean_test_f1"]["steps"]], |
35 | 52 | metrics["mean_test_f1"]["values"], |
| 53 | + linestyle=linestyle_tuple[run_i][1], |
| 54 | + linewidth=4, |
36 | 55 | ) |
37 | 56 |
|
38 | 57 | # bare baseline |
39 | 58 | ax.plot( |
40 | 59 | [1, 6], |
41 | 60 | [bare_metrics["mean_test_f1"]["values"][0]] * 2, |
42 | | - linestyle="--", |
| 61 | + linestyle=linestyle_tuple[len(runs)][1], |
| 62 | + linewidth=4, |
43 | 63 | ) |
44 | 64 |
|
45 | 65 | ax.grid() |
|
0 commit comments