From 1954fb8a9ab3d994bd4312e1e08ea54c3e26e44f Mon Sep 17 00:00:00 2001 From: Daniel Shapero Date: Mon, 28 Oct 2024 11:08:03 -0700 Subject: [PATCH] Corrections to convergence test plots --- demos/convergence-tests/make_plots.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/demos/convergence-tests/make_plots.py b/demos/convergence-tests/make_plots.py index 218a033..28e82e9 100644 --- a/demos/convergence-tests/make_plots.py +++ b/demos/convergence-tests/make_plots.py @@ -8,19 +8,20 @@ parser.add_argument("--output", default="results.pdf") args = parser.parse_args() -model_types = ["ice shelf", "ice stream"] +model_types = ["Ice shelf", "Ice stream"] fig, axes = plt.subplots(nrows=1, ncols=2, sharex=True, sharey=True) -axes[0].set_xlabel("Mesh spacing (meters)") +axes[0].set_xlabel("Mesh spacing (m)") axes[0].set_ylabel("$L^2$-norm relative error") axes[1].get_yaxis().set_visible(False) for ax, model_type in zip(axes, model_types): - filename = model_type.replace(" ", "_") + "_results.json" + filename = model_type.lower().replace(" ", "_") + "_results.json" with open(filename, "r") as input_file: data = json.load(input_file) ax.set_title(f"{model_type} test case") ax.set_xscale("log") + ax.set_xticks([2.5e2, 5e2, 1e3], labels=["$250$", "$500$", "$1000$"]) ax.set_yscale("log") colors = list(matplotlib.colors.TABLEAU_COLORS.keys())