diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2020-02-24 15:02:35 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2020-02-24 15:02:35 +0100 |
| commit | 387017a28282b2cf2e2a52b13c58efe8991dfd75 (patch) | |
| tree | a438d24e762160b024782f3000064bb39258828f | |
| parent | f6b6c83ef7620de8e1bcb2cb4924e1ec70688929 (diff) | |
| download | allocbench-387017a28282b2cf2e2a52b13c58efe8991dfd75.tar.gz allocbench-387017a28282b2cf2e2a52b13c58efe8991dfd75.zip | |
import tikzplotlib only if needed
| -rw-r--r-- | src/plots.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plots.py b/src/plots.py index 4b849d3..99f3d75 100644 --- a/src/plots.py +++ b/src/plots.py @@ -22,7 +22,6 @@ import traceback import matplotlib import matplotlib.pyplot as plt import numpy as np -import tikzplotlib import src.globalvars from src.util import print_debug, print_warn @@ -98,6 +97,7 @@ def plot_single_arg(bench, yval, ylabel="y-label", xlabel="x-label", plt.title(title.format(**label_substitutions)) figname = os.path.join(sumdir, f"{bench.name}.{filepostfix}.{file_ext}") if figname.endswith(".tex"): + import tikzplotlib tikzplotlib.save(figname) else: plt.savefig(figname) @@ -155,6 +155,7 @@ def barplot_single_arg(bench, yval, ylabel="y-label", xlabel="x-label", plt.title(title.format(**label_substitutions)) figname = os.path.join(sumdir, f"{bench.name}.{filepostfix}.{file_ext}") if figname.endswith(".tex"): + import tikzplotlib tikzplotlib.save(figname) else: plt.savefig(figname) @@ -204,6 +205,7 @@ def plot_fixed_arg(bench, yval, ylabel="y-label", xlabel="{loose_arg}", figname = os.path.join(sumdir, f"{bench.name}.{arg}.{arg_value}.{filepostfix}.{file_ext}") if figname.endswith(".tex"): + import tikzplotlib tikzplotlib.save(figname) else: plt.savefig(figname) |
