source: orange/orange/doc/modules/network_read.py @ 6538:a5f65d7f0b2c

Revision 6538:a5f65d7f0b2c, 413 bytes checked in by Mitar <Mitar@…>, 4 years ago (diff)

Made XPM version of the icon 32x32.

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.