'Handle key press.'

def key_press(self, event):

    if (event.key == 'down'):
        self.index += 1
    elif (event.key == 'up'):
        self.index -= 1
    elif (event.key == '    '):
        self.cbar.norm.vmin = self.lims[0]
        self.cbar.norm.vmax = self.lims[1]
    else:
        return
    if (self.index < 0):
        self.index = (len(self.cycle) - 1)
    elif (self.index >= len(self.cycle)):
        self.index = 0
    cmap = self.cycle[self.index]
    self.cbar.set_cmap(cmap)
    self.cbar.draw_all()
    self.mappable.set_cmap(cmap)
    self.cbar.patch.figure.canvas.draw()
