def plot_edges(pts, edges, title=None, clabel=None,
save=None, show=True):
nppts = np.array(pts)
npedges = np.array(edges)
lc = LineCollection(nppts[npedges])
fig = Figure(title=title, clabel=clabel, save=save, show=show)
fig.ax.add_collection(lc)
plt.xlim(nppts[:, 0].min(), nppts[:, 0].max())
plt.ylim(nppts[:, 1].min(), nppts[:, 1].max())
plt.plot(nppts[:, 0], nppts[:, 1], 'ro')
return fig
评论列表
文章目录