I want to plot multiple squares of size 1x1 using meshgrid. The current and expected outputs are presented.
import numpy as np
import matplotlib.pyplot as plt
X = np.array([0,1,2])
Y = np.array([0, -1, -2])
xx, yy = np.meshgrid(X,Y)
plt.plot(xx, yy,"s")
plt.show()
The current output is
The expected output is



plot."s"is for square bullet not for tracing grid. If you aim to draw squares you need to provide coordinate of them in right order using Patches or tracing vertical and horizontal lines usingaxhlineandaxvline.