matplotlib.pyplot 显示散点
程序员文章站
2022-03-19 22:38:15
...
neighbors_result_xy:坐标(x,y)列表
x:x坐标列表
y:y坐标列表
[[196, 527], [269, 383], [237, 541], [189, 395], [167, 538], [146, 531], [143, 458], [152, 435]]
[196, 269, 237, 189, 167, 146, 143, 152]
[527, 383, 541, 395, 538, 531, 458, 435]
import matplotlib.pyplot as plt
x = []
y = []
for i in range(len(neighbors_result_xy)):
x += [neighbors_result_xy[i][0]]
y += [neighbors_result_xy[i][1]]
print(x)
print(y)
# plt.scatter(x, y, marker = 'o',color = 'red', s = 40 ,label = 'First')
plt.scatter(x, y, marker = 'o',color = 'red', s = 40 ,label = 'First')
plt.triplot(points[:,0], points[:,1], tri.simplices.copy())
# plt.plot(points[:,0], points[:,1], 'o')
plt.show()
上一篇: 简易雷达避障效果实现