To illustrate my question, I will generate a simple heatmap.
import matplotlib.pyplot as plt
import numpy as np
heatmap = np.asarray([[20, 0, 40],
[0, 40, 40],
[20, 40, 50]])
heatmap_plot = plt.pcolor(heatmap, cmap='RdBu', vmin=0, vmax=100)
plt.show()
This produces the following image;
Here, one can see that the lower values appear as darker red, and the larger values approach white. How do i reverse this setting? I other words, how do I make lower values lighter shades (0 = white). and larger values represent darker colors, in this case, red.
I couldn't seem to find any such parameter looking at the pcolor documentation.
Just add _r to your cmap. Your new cmap is RdBu_r.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With