diff options
author | Cyril SIX <cyril.six@kalray.eu> | 2019-07-02 11:16:48 +0200 |
---|---|---|
committer | Cyril SIX <cyril.six@kalray.eu> | 2019-07-02 11:16:55 +0200 |
commit | 15cf7f38d7cc5c0794adae8c3cecae7c62b9fff1 (patch) | |
tree | 0727d4ded0498b81dc7e4d72261d168ab764da9a | |
parent | 144fb87e857c06f7dfe8cb68ce7aea79761aecae (diff) | |
download | compcert-kvx-15cf7f38d7cc5c0794adae8c3cecae7c62b9fff1.tar.gz compcert-kvx-15cf7f38d7cc5c0794adae8c3cecae7c62b9fff1.zip |
Better graphs (in greyscale)
-rwxr-xr-x | test/monniaux/gencompile.py | 8 | ||||
-rwxr-xr-x | test/monniaux/gengraphs.py | 13 |
2 files changed, 11 insertions, 10 deletions
diff --git a/test/monniaux/gencompile.py b/test/monniaux/gencompile.py index c2be74db..89a49f8e 100755 --- a/test/monniaux/gencompile.py +++ b/test/monniaux/gencompile.py @@ -30,15 +30,15 @@ oracle_coords = get_coords(oracle_file) fig, ax = plt.subplots() -def do_plot(coords: List[Tuple[int, float]], style: str, label: str): +def do_plot(coords: List[Tuple[int, float]], style: str, label: str, color: str): x = [coord[0] for coord in coords] y = [coord[1] for coord in coords] - plt.plot(x, y, style, label=label) + plt.plot(x, y, style, label=label, color=color) plt.xscale("log") plt.yscale("log") -do_plot(verifier_coords, "b.", "Verifier") -do_plot(oracle_coords, "g+", "Oracle") +do_plot(verifier_coords, "+", "Verifier", "gray") +do_plot(oracle_coords, "+", "Oracle", "black") ax.set_ylabel("Time x1000 (s)") ax.set_xlabel("Size of basic blocks") diff --git a/test/monniaux/gengraphs.py b/test/monniaux/gengraphs.py index 3236f565..b1412e68 100755 --- a/test/monniaux/gengraphs.py +++ b/test/monniaux/gengraphs.py @@ -22,8 +22,6 @@ benches = df["benches"] host_measures_cols = [col for col in df if "host" in col] k1c_measures_cols = [col for col in df if "k1c" in col] -colors = ["forestgreen", "darkorange", "cornflowerblue", "darkorchid", "darksalmon", "dodgerblue", "navy", "gray", "springgreen", "crimson"] - ## # Generating PDF ## @@ -69,11 +67,14 @@ def make_relative_heights(data: Dict[str, List[float]], envs: List[str]) -> Dict def generate_file(f: str, cols: List[str]) -> None: ind = np.arange(len(df[cols[0]])) + compilers = extract_compilers(cols) + mingrey = .7 + greyscale = [i * mingrey / (len(compilers) - 1) for i in range(len(compilers))] + colors = [(gi, gi, gi) for gi in greyscale] - width = 0.25 # the width of the bars + width = (ind[1] - ind[0]) / (len(compilers) + 2) - compilers = extract_compilers(cols) - start_inds = subdivide_interv(ind, ind+2*width, len(compilers)) + start_inds = subdivide_interv(ind, ind+len(compilers)*width, len(compilers)) inverse_cycles = {key:[1./x if isinstance(x, int) else x for x in list(df[key])] for key in df.columns} #heights: Dict[str, List[float]] = make_relative_heights(inverse_cycles, cols) heights = make_relative_heights(inverse_cycles, cols) @@ -88,7 +89,7 @@ def generate_file(f: str, cols: List[str]) -> None: ax.set_yticklabels(['{:,.0%}'.format(x) for x in ax.get_yticks()]) ax.set_xticks(ind) ax.set_xticklabels(benches) - ax.legend() + ax.legend(loc="lower left") plt.setp(ax.get_xticklabels(), rotation=30, horizontalalignment='right') plt.xticks(size=5) |