| 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) == 3: |
| 12 |
fname = sys.argv[1]; |
| 13 |
fname2 = sys.argv[2]; |
| 14 |
else: |
| 15 |
print("Usage: {} fname".format(sys.argv[0])) |
| 16 |
exit(1) |
| 17 |
|
| 18 |
|
| 19 |
qualities = np.loadtxt(fname) |
| 20 |
qualities = np.sort(qualities) |
| 21 |
|
| 22 |
qualities2 = np.loadtxt(fname2) |
| 23 |
qualities2 = np.sort(qualities2) |
| 24 |
|
| 25 |
|
| 26 |
fig, ax = plt.subplots() |
| 27 |
ax.plot(qualities, 'ro') |
| 28 |
ax.plot(qualities2, 'bo') |
| 29 |
ax.set_xlabel("vert") |
| 30 |
ax.set_ylabel("Mesh Quality") |
| 31 |
ax.legend(["before", "after"]) |
| 32 |
|
| 33 |
fig.savefig(fname + ".png", dpi=300) |