def __plotEnds(self, pltax, endname = 'end'):
transitedges = []
transferedges = []
for nid0, nid1, reggedgedata in self.graphtpp.regg.edges(data=True):
if nid0.startswith('end'):
pos0 = self.gnodesplotpos[nid0][:2]
else:
pos0 = self.graphtpp.gnodesplotpos[nid0][:2]
if nid1.startswith('end'):
pos1 = self.gnodesplotpos[nid1][:2]
else:
pos1 = self.graphtpp.gnodesplotpos[nid1][:2]
if (reggedgedata['edgetype'] == 'endtransit'):
transitedges.append([pos0, pos1])
elif (reggedgedata['edgetype'] is 'endtransfer'):
transferedges.append([pos0, pos1])
transitec = mc.LineCollection(transitedges, colors = [.5,0,0,.3], linewidths = 1)
transferec = mc.LineCollection(transferedges, colors = [1,0,0,.3], linewidths = 1)
pltax.add_collection(transferec)
pltax.add_collection(transitec)
评论列表
文章目录