From 52bc0f4ad533f775e71cd78d6c117427114e8909 Mon Sep 17 00:00:00 2001 From: Dominic Kempf <dominic.kempf@iwr.uni-heidelberg.de> Date: Tue, 27 Jun 2017 16:27:12 +0200 Subject: [PATCH] Fixups --- bin/barplot_fine.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/bin/barplot_fine.py b/bin/barplot_fine.py index c3d5b555..c9c008dd 100644 --- a/bin/barplot_fine.py +++ b/bin/barplot_fine.py @@ -54,8 +54,8 @@ r2 = ax.bar(deg, y2, width, color="orange") r1 = ax.bar(deg, y1, width, color="red") ax.set_ylabel("Percentage") -ax.set_xticks(sorted(av['degree'])) -ax.set_xticklabels(["Q{}".format(k) for k in sorted(av['degree'])]) +ax.set_xticks(sorted(av1['degree'])) +ax.set_xticklabels(["Q{}".format(k) for k in sorted(av1['degree'])]) timeframe = pandas.read_csv("./timeratios.csv", header=None, @@ -90,13 +90,16 @@ r3 = ax.bar(deg, y3, width, label="Volume, backward SF", color="yellow") r2 = ax.bar(deg, y2, width, label="Volume, Quadrature", color="orange") r1 = ax.bar(deg, y1, width, label="Volume, forward SF", color="red") -ax.legend(loc=3, - ncol=2, - bbox_to_anchor=(0.05, 1., 1., .1), - ) +lgd = ax.legend(loc=3, + ncol=2, + bbox_to_anchor=(0.05, 1., 1., .1), + ) -for x in av['degree']: - ax.text(x, -0.09, "Flops", rotation=45, horizontalalignment="right") - ax.text(x + 0.6, -0.09, "Time", rotation=45, horizontalalignment="right") +texts = [] +for x in av1['degree']: + texts.append(ax.text(x, -0.09, "Flops", rotation=45, horizontalalignment="right")) + texts.append(ax.text(x + 0.6, -0.09, "Time", rotation=45, horizontalalignment="right")) -plt.savefig(filename) +plt.savefig(filename, + bbox_extra_artists=tuple(texts) + (lgd,), + bbox_inches='tight') -- GitLab