I've searched around and found things that came close to working but nothing exactly suiting what I need.
Basically, I really like the viridis colormap as a starting point. However, I would like to replace the purple at the lowest end of the map with white.
I tried using set_under()
but that doesn't suite my needs.
I need to simply replace purple with white.
For example, I tried the following (from here Matplotlib discrete colorbar) -
cmap = plt.get_cmap('jet')
cmaplist = [cmap(i) for i in range(cmap.N)]
cmaplist[0] = (1.0,1.0,1.0,1.0)
cmap = cmap.from_list('Custom cmap', cmaplist, cmap.N)
Which works perfectly and does exactly what I need with 'jet' but when I replace 'jet' with 'viridis' I get the following error
AttributeError: 'ListedColormap' object has no attribute 'from_list'
How can I get around this and simply do what I want?