I took a function for visualising colour-maps from https://matplotlib.org/stable/tutorials/colors/colormaps.html, and an answer from here to visualise different variations of the colour-map:
import numpy as np
from matplotlib.colors import LinearSegmentedColormap
import matplotlib.pyplot as plt
gradient = np.linspace(0, 1, 256)
gradient = np.vstack((gradient, gradient))
def plot_color_gradients(cmap_list):
# Create figure and adjust figure height to number of colormaps
nrows = len(cmap_list)
figh = 0.35 + 0.15 + (nrows + (nrows - 1) * 0.1) * 0.22
fig, axs = plt.subplots(nrows=nrows + 1, figsize=(6.4, figh))
fig.subplots_adjust(top=1 - 0.35 / figh, bottom=0.15 / figh,
left=0.2, right=0.99)
for ax, name in zip(axs, cmap_list):
ax.imshow(gradient, aspect='auto', cmap=plt.get_cmap(name))
ax.text(-0.01, 0.5, name, va='center', ha='right', fontsize=10,
transform=ax.transAxes)
# Turn off *all* ticks & spines, not just the ones with colormaps.
for ax in axs:
ax.set_axis_off()
# Save colormap list for later.
c = ["darkred", "red", "lightcoral", "white", "palegreen", "green", "darkgreen"]
cmaps = []
v = [0, .15, .4, .5, .6, .9, 1.] # change these
l = list(zip(v, c))
cmaps.append(LinearSegmentedColormap.from_list('rg', l))
v = [0, .15, .25, .5, .75, .9, 1.]
l = list(zip(v, c))
cmaps.append(LinearSegmentedColormap.from_list('rg', l))
v = [0, .1, .2, .5, .8, .9, 1.]
l = list(zip(v, c))
cmaps.append(LinearSegmentedColormap.from_list('rg', l))
plot_color_gradients(cmaps)
plt.show()
Change v for slightly different values to make exactly what you are looking for.