Because "dog" is not a numeric value, you cannot plot it directly. What you need is a mapping between the categorical values and numeric values, e.g. using a dicitionary,
an = {"cow":1,"no animal":0,"chicken":2,"cat":3, "fox":4}
Using this dictionary you can then plot the array of numbers between 0 and 4 using contourf or imshow. The difference between the two can be observed below. Imshow preserves catergories better, as it plots the pixels instead of interpolating between them. And since categories can rarely be interpolated (what's the mean between a cat and a fox?), it's probably closer to what is needed here.
import numpy as np; np.random.seed(0)
import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = (6,2.8)
animals = [['no animal', 'no animal', 'no animal', 'chicken', 'chicken'],
['no animal', 'no animal', 'cow', 'no animal', 'chicken'],
['no animal', 'cow', 'cat', 'cat', 'no animal'],
['no animal', 'cow', 'fox', 'cat', 'no animal'],
['cow', 'cow', 'fox', 'chicken', 'no animal'],
['no animal','cow', 'chicken', 'chicken', 'no animal'],
['no animal', 'no animal', 'chicken', 'cat', 'chicken'],
['no animal', 'no animal', 'no animal', 'cat', 'no animal']]
y = np.linspace(-4,4, 8)
x = np.linspace(-3,3, 5)
X,Y = np.meshgrid(x,y)
an = {"cow":1,"no animal":0,"chicken":2,"cat":3, "fox":4}
aninv = { val: key for key, val in an.items() }
f = lambda x: an[x]
fv = np.vectorize(f)
Z = fv(animals)
fig, (ax, ax2) = plt.subplots(ncols=2)
ax.set_title("contourf"); ax2.set_title("imshow")
im = ax.contourf(X,Y,Z, levels=[-0.5,0.5,1.5,2.5,3.5,4.5] )
cbar = fig.colorbar(im, ax=ax)
cbar.set_ticks([0,1,2,3,4])
cbar.set_ticklabels([aninv[t] for t in [0,1,2,3,4]])
im2 = ax2.imshow(Z, extent=[x.min(), x.max(), y.min(), y.max() ], origin="lower" )
cbar2 = fig.colorbar(im2, ax=ax2 )
cbar2.set_ticks([0,1,2,3,4])
cbar2.set_ticklabels([aninv[t] for t in [0,1,2,3,4]])
plt.tight_layout()
plt.show()
![enter image description here]()