Skip to content

Commit 89d6b2f

Browse files
Till Rettberghagenw
authored andcommitted
Clip soundfield when plotting
1 parent a6e4792 commit 89d6b2f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sfs/plot.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,9 @@ def soundfield(p, grid, xnorm=None, cmap='coolwarm_clip', vmin=-2.0, vmax=2.0,
284284
if ax is None:
285285
ax = plt.gca()
286286

287+
# clip to float64 range for matplotlib 2.1, see #50
288+
p = np.clip(p, -1e15, 1e15)
289+
287290
im = ax.imshow(np.real(p), cmap=cmap, origin='lower',
288291
extent=[x.min(), x.max(), y.min(), y.max()],
289292
vmax=vmax, vmin=vmin, **kwargs)

0 commit comments

Comments
 (0)