Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use "nearest" interpolation for level() plots by default #172

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions sfs/plot2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()`.
Expand All @@ -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)',
Expand Down