Changeset 7768:ec9a34c8739a in orange


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.

Location:
orange/doc/Orange/rst/code
Files:
4 edited

Legend:

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

    r7332 r7768  
    11import Orange.network 
    2 from pylab import * 
     2 
     3from matplotlib import pyplot as plt 
    34 
    45# vertices are placed randomly in Network constructor 
     
    1415    x1, y1 = net.coors[0][u], net.coors[1][u] 
    1516    x2, y2 = net.coors[0][v], net.coors[1][v] 
    16     plot([x1, x2], [y1, y2], 'b-') 
     17    plt.plot([x1, x2], [y1, y2], 'b-') 
    1718 
    1819# read x and y coordinates to Python list 
     
    2122 
    2223# plot vertices 
    23 plot(x, y, 'ro') 
    24 show() 
     24plt.plot(x, y, 'ro') 
     25plt.savefig("network-constructor.py.png") 
  • 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") 
  • orange/doc/Orange/rst/code/network-optimization.py

    r7257 r7768  
    11import Orange.network 
    2 from pylab import * 
     2 
     3from matplotlib import pyplot as plt 
    34 
    45# create graph object of type GraphAsList 
     
    2021    x1, y1 = net.coors[0][u], net.coors[1][u] 
    2122    x2, y2 = net.coors[0][v], net.coors[1][v] 
    22     plot([x1, x2], [y1, y2], 'b-') 
     23    plt.plot([x1, x2], [y1, y2], 'b-') 
    2324 
    2425# read x and y coordinates to Python list 
     
    2728 
    2829# plot vertices 
    29 plot(x, y, 'ro') 
    30 show() 
     30plt.plot(x, y, 'ro') 
     31plt.savefig("network-optimization.py.png") 
  • orange/doc/Orange/rst/code/network-read.py

    r7257 r7768  
    11import Orange.network 
    2 from pylab import * 
     2 
     3from matplotlib import pyplot as plt 
    34 
    45# read network from file 
     
    910    x1, y1 = net.coors[0][u], net.coors[1][u] 
    1011    x2, y2 = net.coors[0][v], net.coors[1][v] 
    11     plot([x1, x2], [y1, y2], 'b-') 
     12    plt.plot([x1, x2], [y1, y2], 'b-') 
    1213 
    1314# read x and y coordinates to Python list 
     
    1617 
    1718# plot vertices 
    18 plot(x, y, 'ro') 
    19 show() 
     19plt.plot(x, y, 'ro') 
     20plt.savefig("network-read.py.png") 
Note: See TracChangeset for help on using the changeset viewer.