Skip to content

Commit d5006b9

Browse files
committed
Use extend='both' for color bars in sound field plots
1 parent 3284bed commit d5006b9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sfs/plot2d.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def _visible_secondarysources(x0, n0, grid):
206206

207207
def amplitude(p, grid, *, xnorm=None, cmap='coolwarm_clip',
208208
vmin=-2.0, vmax=2.0, xlabel=None, ylabel=None,
209-
colorbar=True, colorbar_kwargs={}, ax=None, **kwargs):
209+
colorbar=True, colorbar_kwargs=None, ax=None, **kwargs):
210210
"""Two-dimensional plot of sound field (real part).
211211
212212
Parameters
@@ -330,6 +330,8 @@ def amplitude(p, grid, *, xnorm=None, cmap='coolwarm_clip',
330330
ax.set_xlabel(xlabel)
331331
ax.set_ylabel(ylabel)
332332
if colorbar:
333+
if colorbar_kwargs is None:
334+
colorbar_kwargs = dict(extend='both')
333335
add_colorbar(im, **colorbar_kwargs)
334336
return im
335337

0 commit comments

Comments
 (0)