Skip to content

Commit

Permalink
Corrections to convergence test plots
Browse files Browse the repository at this point in the history
  • Loading branch information
danshapero committed Oct 28, 2024
1 parent eea5bd2 commit 1954fb8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions demos/convergence-tests/make_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 1954fb8

Please sign in to comment.