示例1:
x
= np
.array
([0, 1, 2])
y
= np
.array
([0, 1])
X
, Y
= np
.meshgrid
(x
, y
)
print(X
)
print(Y
)
结果:
[[0 1 2]
[0 1 2]]
[[0 0 0]
[1 1 1]]
示例2:
x
= np
.linspace
(0,60,3)
y
= np
.linspace
(0,40,2)
X
,Y
= np
.meshgrid
(x
, y
)
print(X
)
print(Y
)
[[ 0. 30. 60.]
[ 0. 30. 60.]]
[[ 0. 0. 0.]
[40. 40. 40.]]
引用
转载请注明原文地址: https://win8.8miu.com/read-3878.html