My data is a 100 x 100 array of strings which are all hex codes:
[['#10060e' '#11070f' '#060409' ... '#08030a' '#09030d' '#12050f']
['#110600' '#09010e' '#0d0210' ... '#09030f' '#08060b' '#160a0a']
['#0a070e' '#13060f' '#0c040f' ... '#0c0610' '#0e040c' '#0a020f']
...
['#0c020d' '#09040b' '#10070c' ... '#0a090f' '#160613' '#08000f']
['#0a020f' '#09040a' '#150812' ... '#11040d' '#07040b' '#0b060d']
['#0d0715' '#0e020c' '#140710' ... '#0a0112' '#12090e' '#0c020d']]
Matplotlib: throws this error: TypeError: cannot perform reduce with flexible type
I think the issue it is having is it cannot give a colour to these as they are strings, not numbers. I can only find examples where all the data is numerical and has a colour map applied to it, nothing where every bit of data's colour is specified. I would like to tell Matplotlib what colour I'd like all of these to be using, surprise surprise, the hex codes. How can I go about doing that?
Full(er) code sample:
z = np.asanyarray(pixel_arr)
x = np.arange(0, width, 1) # len = 100
y = np.arange(0, height, 1) # len = 100
fig, ax = plt.subplots()
ax.pcolormesh(x, y, z)
plt.show()