officia doc:
Return coordinate matrices from coordinate vectors
example:
import numpy as np
nx,ny = (3,2)
x = np.linspace(0,1,nx)
y = np.linspace(0,1,ny)
xv,yv = np.meshgrid(x,y)
print("x:\n",x)
print("\ny:\n",y)
print("\nxv:\n",xv)
print("\nyv:\n",yv)
import matplotlib.pyplot as plt
plt.plot(xv,yv,"*")
plt.grid(True)
plt.show()
result:
x:
[0. 0.5 1. ]
y:
[0. 1.]
xv:
[[0. 0.5 1. ]
[0. 0.5 1. ]]
yv:
[[0. 0. 0.]
[1. 1. 1.]]
fig: