欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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()

 

相关标签: Python 可视化