From 789431d7166c508bb971bd03501d1f3770f86c2f Mon Sep 17 00:00:00 2001 From: stavros11 <35475381+stavros11@users.noreply.github.com> Date: Tue, 15 Mar 2022 18:01:24 +0400 Subject: [PATCH] Disable minor yticks in Trotter plot --- plots/evolution.py | 6 ++++-- plots/paper-plots.ipynb | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/plots/evolution.py b/plots/evolution.py index ae1a155..94c8dee 100644 --- a/plots/evolution.py +++ b/plots/evolution.py @@ -47,7 +47,7 @@ def plot_dense(data, quantity, nqubits, fontsize=30, legend=True, save=False): plt.show() -def plot_trotter(data, quantity, nqubits, fontsize=30, legend=False, save=False): +def plot_trotter(data, quantity, nqubits, fontsize=30, yticks=None, legend=False, save=False): matplotlib.rcParams["font.size"] = fontsize cpu_cp = sns.color_palette("Oranges", 4) @@ -92,7 +92,9 @@ def plot_trotter(data, quantity, nqubits, fontsize=30, legend=False, save=False) if legend: plt.legend(fontsize="small") - + if yticks is not None: + plt.minorticks_off() + plt.yticks(yticks) if save: plt.savefig(f"evolution_trotter_{nqubits}qubits_{quantity}.pdf", bbox_inches="tight") else: diff --git a/plots/paper-plots.ipynb b/plots/paper-plots.ipynb index fcc9ff6..04b78c7 100644 --- a/plots/paper-plots.ipynb +++ b/plots/paper-plots.ipynb @@ -20,7 +20,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "id": "97f43ed0", "metadata": {}, "outputs": [], @@ -308,8 +308,8 @@ "from evolution import plot_trotter\n", "\n", "data = load_evolution_data(\"data/evolution.dat\")\n", - "plot_trotter(data, \"total_dry_time\", 10, save=save)\n", - "plot_trotter(data, \"total_dry_time\", 20, legend=True, save=save)" + "plot_trotter(data, \"total_dry_time\", 10, yticks=[1, 10], legend=True, save=save)\n", + "plot_trotter(data, \"total_dry_time\", 20, yticks=[1, 10, 100], legend=False, save=save)" ] } ],