diff --git a/betree/haura-benchmarks/haura-plots/haura_plots/__init__.py b/betree/haura-benchmarks/haura-plots/haura_plots/__init__.py index 4f05c4f6..26ea2d3d 100755 --- a/betree/haura-benchmarks/haura-plots/haura_plots/__init__.py +++ b/betree/haura-benchmarks/haura-plots/haura_plots/__init__.py @@ -248,6 +248,9 @@ def main(): sys.exit(2) data = [] + # Prep the color scheme + util.init_colormap() + for path in sys.argv[1:]: with open(f"{path}/betree-metrics.jsonl", 'r', encoding="UTF-8") as metrics: data = util.read_jsonl(metrics) diff --git a/betree/haura-benchmarks/haura-plots/haura_plots/cache_plots.py b/betree/haura-benchmarks/haura-plots/haura_plots/cache_plots.py index 0b0651c3..1f9346dd 100644 --- a/betree/haura-benchmarks/haura-plots/haura_plots/cache_plots.py +++ b/betree/haura-benchmarks/haura-plots/haura_plots/cache_plots.py @@ -16,7 +16,7 @@ def plot_cache(data, path): # Capacity vs Size (Peak Check) cap = np.array([temp['cache']['capacity'] / 1024 / 1024 for temp in data]) - axs[0].plot(epoch, cap, label='capacity') + axs[0].plot(epoch, cap, label='capacity', linestyle=':') axs[0].plot(epoch, [temp['cache']['size'] / 1024 / 1024 for temp in data], label='size') axs[0].set_xticks(eticks, eticks_formatted) axs[0].set_ylabel("Size [MiB]") @@ -43,7 +43,7 @@ def plot_cache(data, path): oax.legend(bbox_to_anchor=(1.0, 1.2)) axs[1].legend(ncols=2, bbox_to_anchor=(0.8, 1.2)) - # insertions (reads, new nodes, updates, writes) vs evictions (updates) vs removals (reads) + # insertions (reads, new nodes, updates, writes) vs evictions (updates, reads) vs removals (updates) axs[2].plot(epoch, util.diff_window([temp['cache']['insertions'] for temp in data]), label='insertions') axs[2].plot(epoch, util.diff_window([temp['cache']['evictions'] for temp in data]), label='evictions') axs[2].plot(epoch, util.diff_window([temp['cache']['removals'] for temp in data]), label='removals') diff --git a/betree/haura-benchmarks/haura-plots/haura_plots/util.py b/betree/haura-benchmarks/haura-plots/haura_plots/util.py index 9f5e5f06..8ca9a46d 100644 --- a/betree/haura-benchmarks/haura-plots/haura_plots/util.py +++ b/betree/haura-benchmarks/haura-plots/haura_plots/util.py @@ -3,6 +3,8 @@ """ import json +import matplotlib.pyplot as plt +from cycler import cycler # Constants BLOCK_SIZE=4096 @@ -21,6 +23,20 @@ MARKERS=['x', '.', '^', 'v', '<', '>'] +def init_colormap(): + """Create the "Wong" color scheme and set it as matplotlib default.""" + wong = cycler(linestyle=['-', '--', '-.']) * cycler(color=[ + "#56B4E9", + "#E69F00", + "#009E73", + "#F0E442", + "#0072B2", + "#D55E00", + "#CC79A7", + "#000000", + ]) + plt.rc('axes', prop_cycle=wong) + # Formatting def ms_to_string(time): """Nicer formatter for epoch strings in figures"""