Skip to content

Commit

Permalink
Disable minor yticks in Trotter plot
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros11 committed Mar 15, 2022
1 parent ded34d2 commit 789431d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions plots/evolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions plots/paper-plots.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "97f43ed0",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -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)"
]
}
],
Expand Down

0 comments on commit 789431d

Please sign in to comment.