| 1 |
#!/usr/bin/env python |
| 2 |
|
| 3 |
import numpy as np |
| 4 |
import matplotlib |
| 5 |
import matplotlib.tri |
| 6 |
import matplotlib.pyplot as plt |
| 7 |
import sys |
| 8 |
|
| 9 |
# plots the output of printVertEdges |
| 10 |
|
| 11 |
if len(sys.argv) == 2: |
| 12 |
fname = sys.argv[1]; |
| 13 |
else: |
| 14 |
print("Usage: {} fname".format(sys.argv[0])) |
| 15 |
exit(1) |
| 16 |
|
| 17 |
xi1_vals = np.loadtxt(fname + "_xi1_vals.txt") |
| 18 |
xi2_vals = np.loadtxt(fname + "_xi2_vals.txt") |
| 19 |
f_vals = np.loadtxt(fname + "_func_vals.txt") |
| 20 |
|
| 21 |
print("min val = ", np.amin(f_vals)) |
| 22 |
|
| 23 |
X, Y = np.meshgrid(xi1_vals, xi2_vals); |
| 24 |
|
| 25 |
|
| 26 |
fig, ax = plt.subplots() |
| 27 |
c = ax.contourf(X, Y, f_vals, 20) |
| 28 |
|
| 29 |
ax.set_xlabel("xi1") |
| 30 |
ax.set_ylabel("xi2") |
| 31 |
fig.colorbar(c, ax=ax) |
| 32 |
|
| 33 |
fig.savefig(fname + ".png", dpi=300) |