I am struggling to create the color bar that I want in matplotlib. Ideally it would look like more like this (lows are greys, highs are bright red:
However I am getting the following:
from matplotlib import cm
from matplotlib.colors import ListedColormap, LinearSegmentedColormap
colors_top = cm.get_cmap('Greys_r', 128)
colors_bot = cm.get_cmap('Reds', 128)
cmap_grey_red = ListedColormap(
np.vstack((
colors_top(np.linspace(0, 1, 128)),
colors_bot(np.linspace(0, 1, 128))
)), name='GreyRed'
)
How can I correct this color bar?