Ignore:
Timestamp:
03/22/11 15:10:35 (3 years ago)
Author:
miha <miha.stajdohar@…>
Branch:
default
Convert:
84458d5f26fe77fe6982a487e8dab650ba9bbe33
Message:

Changed from pylab import * to from matplotlib import pyplot as plt.
Save image to file instead of opening a pylab widget.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/doc/Orange/rst/code/network-graph-analysis.py

    r7454 r7768  
    11import Orange.network 
    22 
    3 from pylab import * 
     3from matplotlib import pyplot as plt 
    44 
    5          
    65# vertices are placed randomly in NetworkOptimization constructor 
    76network = Orange.network.NetworkOptimization() 
     
    5352    x1, y1 = subnet.coors[0][u], subnet.coors[1][u] 
    5453    x2, y2 = subnet.coors[0][v], subnet.coors[1][v] 
    55     plot([x1, x2], [y1, y2], 'b-')         
     54    plt.plot([x1, x2], [y1, y2], 'b-')         
    5655         
    5756# read x and y coordinates to Python list 
     
    6059 
    6160# plot vertices of subnetwork 
    62 plot(x, y, 'ro') 
    63 show() 
     61plt.plot(x, y, 'ro') 
     62plt.savefig("network-graph-analysis.py.png") 
Note: See TracChangeset for help on using the changeset viewer.