Skip to content

Commit

Permalink
Cosmetic changes to the tile filtering example
Browse files Browse the repository at this point in the history
  • Loading branch information
mmacklin authored and shi-eric committed Dec 2, 2024
1 parent dc488eb commit 2c3d619
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions warp/examples/tile/example_tile_filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,21 @@ def conv_tiled(x: wp.array2d(dtype=wp.vec2d), y: wp.array2d(dtype=wp.vec2d), z:
try:
import matplotlib.pyplot as plt

plt.figure()
plt.plot(
fig, ax = plt.subplots(figsize=(10, 5))

ax.plot(
x,
"r-",
color="#DDDDDD",
linewidth=2,
label="Original",
)
plt.plot(y_test[0, :].real, "b.-", label="Smoothed")
plt.legend()
plt.savefig("filter.png")
ax.plot(y_test[0, :].real, color="#76B900", linewidth=3, label="Smoothed")

ax.legend()
ax.grid(True)

plt.tight_layout()
plt.show()

except ModuleNotFoundError:
print("Matplotlib not available; skipping figure")

0 comments on commit 2c3d619

Please sign in to comment.