regriptppass.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:pyhiro 作者: wanweiwei07 项目源码 文件源码
def plotshortestpath(self, pltax, id=0):
        """
        plot the shortest path

        :param id:
        :return:
        """

        for i,path in enumerate(self.directshortestpaths):
            if i is id:
                pathedges = []
                pathlength = len(path)
                for pnidx in range(pathlength-1):
                    nid0 = path[pnidx]
                    nid1 = path[pnidx+1]
                    pathedges.append([self.composedgnodesplotpos[nid0][:2], self.composedgnodesplotpos[nid1][:2]])
                pathedgesec = mc.LineCollection(pathedges, colors=[0, 1, 0, 1], linewidths=5)

                pltax.add_collection(pathedgesec)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号