Skip to content

Commit 4815e1e

Browse files
committed
FIX: Minor fix
1 parent e4b531a commit 4815e1e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

nibabel/viewers.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@ def __init__(self, data, affine=None, axes=None, cmap='gray',
163163
# Set up volumes axis
164164
if self.n_volumes > 1 and len(self._axes) > 3:
165165
ax = self._axes[3]
166-
ax.set_axis_bgcolor('k')
166+
try:
167+
ax.set_facecolor('k')
168+
except AttributeError: # old mpl
169+
ax.set_axis_bgcolor('k')
167170
ax.set_title('Volumes')
168171
y = np.zeros(self.n_volumes + 1)
169172
x = np.arange(self.n_volumes + 1) - 0.5
@@ -363,7 +366,7 @@ def _set_position(self, x, y, z, notify=True):
363366

364367
# Update volume trace
365368
if self.n_volumes > 1 and len(self._axes) > 3:
366-
idx = [None, Ellipsis] * 3
369+
idx = [slice(None)] * len(self._axes)
367370
for ii in range(3):
368371
idx[self._order[ii]] = self._data_idx[ii]
369372
vdata = self._data[idx].ravel()

0 commit comments

Comments
 (0)