Specify cmap to specify the color with matplotlib
import numpy as np
import matplotlib.pyplot as plt
x = np.random.random((100, 100))
plt.imshow(x, cmap="GnBu")
plt.colorbar()
I've specified GnBu
(I think it's Green-Blue) here, but there are many other colors defined:
http://matplotlib.org/examples/color/colormaps_reference.html
Many of these have opposite colors (such as _r
followed by: gray_r
).
Recommended Posts