Consider this example
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.scatter([1,2,3], [1,2,3], c=[0,1,2], cmap=plt.cm.get_cmap("brg"), s=100)
How can I see the RGBA values selected by this color map? Note that the docs state
LinearSegmentedColormaps do not have a .colors attribute. However, one may still call the colormap with an integer array, or with a float array between 0 and 1.
However, when I attempt this, it does not appear to work.
import numpy as np
cmap = plt.cm.get_cmap("brg")
cmap(np.array([0,1,2], dtype='int64'))
array([[0. , 0. , 1. , 1. ],
[0.00784314, 0. , 0.99215686, 1. ],
[0.01568627, 0. , 0.98431373, 1. ]])
These RGBA values don't align with what I expect (blue, red, green).