I have a RGBA array (img) with 2D x and y like this:
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(100)
x = np.arange(10, 20)
y = np.arange(0, 10)
x, y = np.meshgrid(x, y)
img = np.random.randint(low=0, high=255, size=(10, 10, 4))
According to this question, we can pass any array to plot and set the color using img:
fig, axs = plt.subplots()
axs.pcolormesh(x, y, img[:, :,0], color=img.reshape((img.shape[0]*img.shape[1]), 4)/255)
However, it just changed the edgecolors.
I want to show it like axs.imshow(img)


