1
########################################################################
3
# Vision Network - Python source code - file generated by vision
4
# Monday 16 April 2007 13:44:49
6
# The Scripps Research Institute (TSRI)
7
# Molecular Graphics Lab
8
# La Jolla, CA 92037, USA
10
# Copyright: Daniel Stoffler, Michel Sanner and TSRI
12
# revision: Guillaume Vareille
14
#########################################################################
16
# $Header: /opt/cvs/python/packages/share1.5/Vision/doc/Examples/matplotlib/Histogram_net.py,v 1.3 2007/08/29 20:37:16 vareille Exp $
18
# $Id: Histogram_net.py,v 1.3 2007/08/29 20:37:16 vareille Exp $
21
from traceback import print_exc
22
## loading libraries ##
23
from Vision.matplotlibNodes import matplotliblib
24
masterNet.getEditor().addLibraryInstance(matplotliblib,"Vision.matplotlibNodes", "matplotliblib")
26
from Vision.StandardNodes import stdlib
27
masterNet.getEditor().addLibraryInstance(stdlib,"Vision.StandardNodes", "stdlib")
30
## saving node Histogram ##
31
from Vision.matplotlibNodes import HistogramNE
32
Histogram_8 = HistogramNE(constrkw = {}, name='Histogram', library=matplotliblib)
33
masterNet.addNode(Histogram_8,33,377)
34
Histogram_8.inputPortByName['bins'].widget.set(50, run=False)
35
Histogram_8.inputPortByName['patch_facecolor'].widget.set("green", run=False)
36
apply(Histogram_8.configure, (), {'expanded': True})
38
print "WARNING: failed to restore HistogramNE named Histogram in network masterNet"
43
## saving node Draw Area ##
44
from Vision.matplotlibNodes import MPLDrawAreaNE
45
Draw_Area_9 = MPLDrawAreaNE(constrkw = {}, name='Draw Area', library=matplotliblib)
46
masterNet.addNode(Draw_Area_9,119,326)
48
print "WARNING: failed to restore MPLDrawAreaNE named Draw Area in network masterNet"
53
## saving node ReadTable ##
54
from Vision.StandardNodes import ReadTable
55
ReadTable_10 = ReadTable(constrkw = {}, name='ReadTable', library=stdlib)
56
masterNet.addNode(ReadTable_10,73,7)
57
ReadTable_10.inputPortByName['filename'].widget.set("Data/histogram_data_1.dat", run=False)
58
ReadTable_10.inputPortByName['sep'].widget.set(",", run=False)
59
ReadTable_10.inputPortByName['datatype'].widget.set("float", run=False)
60
apply(ReadTable_10.configure, (), {'expanded': True})
62
print "WARNING: failed to restore ReadTable named ReadTable in network masterNet"
67
## saving node Index ##
68
from Vision.StandardNodes import Index
69
Index_11 = Index(constrkw = {}, name='Index', library=stdlib)
70
masterNet.addNode(Index_11,12,208)
71
apply(Index_11.configure, (), {'expanded': True})
73
print "WARNING: failed to restore Index named Index in network masterNet"
78
## saving node Plot ##
79
from Vision.matplotlibNodes import PlotNE
80
Plot_12 = PlotNE(constrkw = {}, name='Plot', library=matplotliblib)
81
masterNet.addNode(Plot_12,287,332)
82
Plot_12.inputPortByName['lineStyle'].widget.set("dashed", run=False)
83
Plot_12.inputPortByName['color'].widget.set("red", run=False)
84
apply(Plot_12.configure, (), {'expanded': True})
86
print "WARNING: failed to restore PlotNE named Plot in network masterNet"
91
## saving node Index ##
92
from Vision.StandardNodes import Index
93
Index_13 = Index(constrkw = {}, name='Index', library=stdlib)
94
masterNet.addNode(Index_13,163,197)
95
apply(Index_13.inputPortByName['index'].widget.configure, (), {'max': 2})
96
Index_13.inputPortByName['index'].widget.set(1, run=False)
97
apply(Index_13.configure, (), {'expanded': True})
99
print "WARNING: failed to restore Index named Index in network masterNet"
104
## saving node Index ##
105
from Vision.StandardNodes import Index
106
Index_14 = Index(constrkw = {}, name='Index', library=stdlib)
107
masterNet.addNode(Index_14,325,191)
108
apply(Index_14.inputPortByName['index'].widget.configure, (), {'max': 2})
109
Index_14.inputPortByName['index'].widget.set(2, run=False)
110
apply(Index_14.configure, (), {'expanded': True})
112
print "WARNING: failed to restore Index named Index in network masterNet"
117
## saving node MultiPlot ##
118
from Vision.matplotlibNodes import MultiPlotNE
119
MultiPlot_15 = MultiPlotNE(constrkw = {}, name='MultiPlot', library=matplotliblib)
120
masterNet.addNode(MultiPlot_15,185,515)
122
print "WARNING: failed to restore MultiPlotNE named MultiPlot in network masterNet"
128
## saving connections for network Histogram ##
129
if Draw_Area_9 is not None and Histogram_8 is not None:
131
masterNet.connectNodes(
132
Draw_Area_9, Histogram_8, "drawAreaDef", "drawAreaDef", blocking=True)
134
print "WARNING: failed to restore connection between Draw_Area_9 and Histogram_8 in network masterNet"
135
if ReadTable_10 is not None and Index_11 is not None:
137
masterNet.connectNodes(
138
ReadTable_10, Index_11, "data", "data", blocking=True)
140
print "WARNING: failed to restore connection between ReadTable_10 and Index_11 in network masterNet"
141
if Index_11 is not None and Histogram_8 is not None:
143
masterNet.connectNodes(
144
Index_11, Histogram_8, "data", "values", blocking=True)
146
print "WARNING: failed to restore connection between Index_11 and Histogram_8 in network masterNet"
147
if ReadTable_10 is not None and Index_13 is not None:
149
masterNet.connectNodes(
150
ReadTable_10, Index_13, "data", "data", blocking=True)
152
print "WARNING: failed to restore connection between ReadTable_10 and Index_13 in network masterNet"
153
if ReadTable_10 is not None and Index_14 is not None:
155
masterNet.connectNodes(
156
ReadTable_10, Index_14, "data", "data", blocking=True)
158
print "WARNING: failed to restore connection between ReadTable_10 and Index_14 in network masterNet"
159
if Index_14 is not None and Plot_12 is not None:
161
masterNet.connectNodes(
162
Index_14, Plot_12, "data", "x", blocking=True)
164
print "WARNING: failed to restore connection between Index_14 and Plot_12 in network masterNet"
165
if Index_13 is not None and Plot_12 is not None:
167
masterNet.connectNodes(
168
Index_13, Plot_12, "data", "y", blocking=True)
170
print "WARNING: failed to restore connection between Index_13 and Plot_12 in network masterNet"
171
if Histogram_8 is not None and MultiPlot_15 is not None:
173
masterNet.connectNodes(
174
Histogram_8, MultiPlot_15, "plot", "multiplot", blocking=True)
176
print "WARNING: failed to restore connection between Histogram_8 and MultiPlot_15 in network masterNet"
177
if Plot_12 is not None and MultiPlot_15 is not None:
179
masterNet.connectNodes(
180
Plot_12, MultiPlot_15, "plot", "multiplot", blocking=True)
182
print "WARNING: failed to restore connection between Plot_12 and MultiPlot_15 in network masterNet"