source: orange/Orange/doc/modules/network_read.py @ 9671:a7b056375472

Revision 9671:a7b056375472, 413 bytes checked in by anze <anze.staric@…>, 2 years ago (diff)

Moved orange to Orange (part 2)

Line 
1import orngNetwork
2from pylab import *
3
4# read network from file
5net = orngNetwork.Network.read("K5.net")
6
7# read all edges and plot a line
8for u, v in net.getEdges():
9    x1, y1 = net.coors[0][u], net.coors[1][u]
10    x2, y2 = net.coors[0][v], net.coors[1][v]
11    plot([x1, x2], [y1, y2], 'b-')
12
13# read x and y coordinates to Python list
14x = net.coors[0]
15y = net.coors[1]
16
17# plot vertices
18plot(x, y, 'ro')
19show()
Note: See TracBrowser for help on using the repository browser.