plt.imshow is used to visualize image-like arrays and will plot the pixel intensity for each pixel location using a colormap (or would directly use the colors in case the image has 3 channels), while plt.plot would visualize each “row” of the input array as a new line and would use the pixel intensities as the y-value.