data = np.ma.masked_equal(data, 0)
fig, ax = plt.subplots()
im = ax.imshow(data, interpolation='nearest', cmap=cmap)
fig.colorbar(im)
plt.show()
How to create matplotlib colormap that treats one value specially?