Skip to content

Commit

Permalink
Merge branch 'mmacklin/tile-filtering-cosmetic' into 'main'
Browse files Browse the repository at this point in the history
Cosmetic changes to the tile filtering example

See merge request omniverse/warp!906
  • Loading branch information
shi-eric committed Dec 2, 2024
2 parents fa8cf1a + 8c28f17 commit 1bab08d
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 1bab08d

Please sign in to comment.