source: orange/Orange/testing/regression/tests_20/modules_network_read.py @ 9952:986e9cd806f4

Revision 9952:986e9cd806f4, 413 bytes checked in by Miha Stajdohar <miha.stajdohar@…>, 2 years ago (diff)

Tests moved and renamed from orange 20.

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.