From a7f262f1a10b7cbbabf54ee52027d3dc30817e45 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Sat, 23 Jan 2021 22:55:05 +0100 Subject: [PATCH] Use "nearest" interpolation for level() plots by default --- sfs/plot2d.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sfs/plot2d.py b/sfs/plot2d.py index efadb9c0..affab0d2 100644 --- a/sfs/plot2d.py +++ b/sfs/plot2d.py @@ -310,7 +310,7 @@ def amplitude(p, grid, *, xnorm=None, cmap='coolwarm_clip', def level(p, grid, *, xnorm=None, power=False, cmap=None, vmax=3, vmin=-50, - **kwargs): + interpolation='nearest', **kwargs): """Two-dimensional plot of level (dB) of sound field. Takes the same parameters as `sfs.plot2d.amplitude()`. @@ -325,8 +325,9 @@ def level(p, grid, *, xnorm=None, power=False, cmap=None, vmax=3, vmin=-50, if xnorm is not None: p = _util.normalize(p, grid, xnorm) L = _util.db(p, power=power) - return amplitude(L, grid=grid, xnorm=None, cmap=cmap, - vmax=vmax, vmin=vmin, **kwargs) + return amplitude( + L, grid=grid, xnorm=None, cmap=cmap, vmax=vmax, vmin=vmin, + interpolation=interpolation, **kwargs) def particles(x, *, trim=None, ax=None, xlabel='x (m)', ylabel='y (m)',