self.ax.imshow(im, vmin=self.vmin, vmax=self.vmax, interpolation=None)

def __call__(self, event):
    old_i = self.i
if event.key == 'right':
    self.i = min(self.im.shape[2] - 1, self.i + 1)
elif event.key == 'left':
    self.i = max(0, self.i - 1)
if old_i != self.i:
    self.draw()
self.fig.canvas.draw()

def slice_show(im, i=0):
    plotter(im, i)
Серия 2D-срезов 3D-массива в numpy