new_map = matplotlib.colors.LinearSegmentedColormap.from_list('new_map',
    colors, N=256)
pcolor(data, cmap=new_map)
savefig('map.png')
show()
Setting arbitrary color in pseudocolor plot with matplotlib