Let's say I have a 10x10 matrix, that is comprised or just 0s and 1s, represented as a list of lists. How could I use matplotlib
to represent such a matrix as a grid of red and black squares? (red for 1, black for 0).
I've search extensively, but the closest I could find was Plot a black-and-white binary map in matplotlib
, but the colors are floats less than 1. Once I get 1s in the data, the plot goes awry. Can anyone help? Or point to specific matplotlib documentation that would help me overcome this?