I need to plot an image filled with geophysical values ranging from 0.0 to 1.0 using a rainbow colormap.
I tried the existing rainbow colormap from matplotlib but I am not fully satisfied with it:
from matplotlib import pyplot as plt
import numpy as np
plt.pcolor(np.random.rand(10,10),cmap='rainbow')
plt.colorbar()
plt.show()
How do I create a colormap that ranges from black for a value of 0.0 and then gradually shows the following colors: violet, blue, cyan, green, yellow and finally red for a value of 1.0?