~ubuntu-branches/ubuntu/natty/mgltools-vision/natty

« back to all changes in this revision

Viewing changes to Vision/doc/Examples/matplotlib/SetmatplotlibOptions_net.py

  • Committer: Bazaar Package Importer
  • Author(s): Steffen Moeller
  • Date: 2008-07-31 22:00:08 UTC
  • Revision ID: james.westby@ubuntu.com-20080731220008-broax3qn6pq9ygnb
Tags: upstream-1.5.2.cvs.20080731
ImportĀ upstreamĀ versionĀ 1.5.2.cvs.20080731

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
########################################################################
 
2
#
 
3
#    Vision Network - Python source code - file generated by vision
 
4
#    Tuesday 17 April 2007 10:25:23 
 
5
#    
 
6
#       The Scripps Research Institute (TSRI)
 
7
#       Molecular Graphics Lab
 
8
#       La Jolla, CA 92037, USA
 
9
#
 
10
# Copyright: Daniel Stoffler, Michel Sanner and TSRI
 
11
#   
 
12
# revision: Guillaume Vareille
 
13
#  
 
14
#########################################################################
 
15
#
 
16
# $Header: /opt/cvs/python/packages/share1.5/Vision/doc/Examples/matplotlib/SetmatplotlibOptions_net.py,v 1.2 2007/08/29 20:37:16 vareille Exp $
 
17
#
 
18
# $Id: SetmatplotlibOptions_net.py,v 1.2 2007/08/29 20:37:16 vareille Exp $
 
19
#
 
20
 
 
21
from traceback import print_exc
 
22
## loading libraries ##
 
23
from Vision.matplotlibNodes import matplotliblib
 
24
masterNet.getEditor().addLibraryInstance(matplotliblib,"Vision.matplotlibNodes", "matplotliblib")
 
25
 
 
26
try:
 
27
    ## saving node Set Matplotlib options ##
 
28
    from Vision.matplotlibNodes import MatPlotLibOptions
 
29
    Set_Matplotlib_options_20 = MatPlotLibOptions(constrkw = {}, name='Set Matplotlib options', library=matplotliblib)
 
30
    masterNet.addNode(Set_Matplotlib_options_20,202,77)
 
31
    Set_Matplotlib_options_20.inputPortByName['matplotlibOptions'].widget.set({'edgecolor': 'indigo', 'ytick.color': 'darkgreen', 'figpatch_facecolor': 'lightsalmon', 'facecolor': 'gold', 'figpatch_linewidth': 1.0, 'markeredgewidth': 6.8888888888888777, 'xtick.color': 'darkgreen', 'gridlinewidth': 4.6944444444444366, 'gridlinestyle': '--', 'figpatch_edgecolor': 'white', 'gridcolor': 'firebrick', 'gridOn': 1, 'ytick.labelsize': 19.250000000000046, 'xtick.labelsize': 17.388888888888907, 'linewidth': 5.4444444444444393, 'anchor': 'C'}, run=False)
 
32
except:
 
33
    print "WARNING: failed to restore MatPlotLibOptions named Set Matplotlib options in network masterNet"
 
34
    print_exc()
 
35
    Set_Matplotlib_options_20=None
 
36
 
 
37
try:
 
38
    ## saving node SinFunc ##
 
39
    from Vision.matplotlibNodes import SinFunc
 
40
    SinFunc_21 = SinFunc(constrkw = {}, name='SinFunc', library=matplotliblib)
 
41
    masterNet.addNode(SinFunc_21,35,11)
 
42
    apply(SinFunc_21.configure, (), {'expanded': True})
 
43
except:
 
44
    print "WARNING: failed to restore SinFunc named SinFunc in network masterNet"
 
45
    print_exc()
 
46
    SinFunc_21=None
 
47
 
 
48
try:
 
49
    ## saving node Plot ##
 
50
    from Vision.matplotlibNodes import PlotNE
 
51
    Plot_22 = PlotNE(constrkw = {}, name='Plot', library=matplotliblib)
 
52
    masterNet.addNode(Plot_22,41,158)
 
53
    apply(Plot_22.configure, (), {'expanded': True})
 
54
except:
 
55
    print "WARNING: failed to restore PlotNE named Plot in network masterNet"
 
56
    print_exc()
 
57
    Plot_22=None
 
58
 
 
59
masterNet.freeze()
 
60
 
 
61
## saving connections for network new ##
 
62
if SinFunc_21 is not None and Plot_22 is not None:
 
63
    try:
 
64
        masterNet.connectNodes(
 
65
            SinFunc_21, Plot_22, "y", "y", blocking=True)
 
66
    except:
 
67
        print "WARNING: failed to restore connection between SinFunc_21 and Plot_22 in network masterNet"
 
68
if Set_Matplotlib_options_20 is not None and Plot_22 is not None:
 
69
    try:
 
70
        masterNet.connectNodes(
 
71
            Set_Matplotlib_options_20, Plot_22, "matplotlibOptions", "drawAreaDef", blocking=True)
 
72
    except:
 
73
        print "WARNING: failed to restore connection between Set_Matplotlib_options_20 and Plot_22 in network masterNet"
 
74
masterNet.unfreeze()
 
75
#masterNet.run()
 
76