cmap = mpl.colors.ListedColormap(['r','gold','limegreen','darkturquoise','indigo'])
cmap.set_under('silver')
cmap.set_over('silver')

bounds = [10, 20, 30, 50, 70, 90]
norm = mpl.colors.BoundaryNorm(bounds, cmap.N)
vmin, vmax = min(bounds), max(bounds)

ticks  = (np.array(bounds[:-1])+np.array(bounds[1:]))/2
labels = ['A', 'B', 'C', 'D', 'E']

plt.imshow(a, cmap=cmap, norm=norm, interpolation='nearest',
           vmin=vmin, vmax=vmax)

cbar = plt.colorbar(aspect=30, extend='both')
cbar.ax.tick_params(axis='y', right='off', labelsize=20)
cbar.set_ticks(ticks)
cbar.set_ticklabels(labels)

plt.show()