I'd like to plot a 2-d matrix from numpy as a colored matrix in Matplotlib. I have the following 9-by-9 array:
my_array = diag(ones(9))
# plot the array
pcolor(my_array)
I'd like to set the first three elements of the diagonal to be a certain color, the next three to be a different color, and the last three a different color. I'd like to specify the color by a hex code string, like "#FF8C00". How can I do this?
Also, how can I set the color of 0-valued elements for pcolor?