######################################################################## # # Vision Network - Python source code - file generated by vision # Friday 13 April 2007 12:31:42 # # The Scripps Research Institute (TSRI) # Molecular Graphics Lab # La Jolla, CA 92037, USA # # Copyright: Daniel Stoffler, Michel Sanner and TSRI # # revision: Guillaume Vareille # ######################################################################### # # $Header: /export/cvs/python/packages/share1.5/Vision/Examples/matplotlib/Axes_net.py,v 1.2 2007/04/16 19:05:51 sowjanya Exp $ # # $Id: Axes_net.py,v 1.2 2007/04/16 19:05:51 sowjanya Exp $ # from traceback import print_exc ## loading libraries ## from Vision.matplotlibNodes import matplotliblib masterNet.getEditor().addLibraryInstance(matplotliblib,"Vision.matplotlibNodes", "matplotliblib") from Vision.StandardNodes import stdlib masterNet.getEditor().addLibraryInstance(stdlib,"Vision.StandardNodes", "stdlib") try: ## saving node ReadTable ## from Vision.StandardNodes import ReadTable ReadTable_0 = ReadTable(constrkw = {}, name='ReadTable', library=stdlib) masterNet.addNode(ReadTable_0,187,7) ReadTable_0.inputPortByName['filename'].widget.set("Data/axes_data.dat", run=False) ReadTable_0.inputPortByName['sep'].widget.set(",", run=False) ReadTable_0.inputPortByName['datatype'].widget.set("float", run=False) apply(ReadTable_0.configure, (), {'expanded': True}) except: print "WARNING: failed to restore ReadTable named ReadTable in network masterNet" print_exc() ReadTable_0=None try: ## saving node Index ## from Vision.StandardNodes import Index Index_1 = Index(constrkw = {}, name='Index', library=stdlib) masterNet.addNode(Index_1,17,143) apply(Index_1.configure, (), {'expanded': True}) except: print "WARNING: failed to restore Index named Index in network masterNet" print_exc() Index_1=None try: ## saving node Index ## from Vision.StandardNodes import Index Index_2 = Index(constrkw = {}, name='Index', library=stdlib) masterNet.addNode(Index_2,137,143) apply(Index_2.inputPortByName['index'].widget.configure, (), {'max': 3}) Index_2.inputPortByName['index'].widget.set(1, run=False) apply(Index_2.configure, (), {'expanded': True}) except: print "WARNING: failed to restore Index named Index in network masterNet" print_exc() Index_2=None try: ## saving node Index ## from Vision.StandardNodes import Index Index_3 = Index(constrkw = {}, name='Index', library=stdlib) masterNet.addNode(Index_3,254,134) apply(Index_3.inputPortByName['index'].widget.configure, (), {'max': 3}) Index_3.inputPortByName['index'].widget.set(2, run=False) apply(Index_3.configure, (), {'expanded': True}) except: print "WARNING: failed to restore Index named Index in network masterNet" print_exc() Index_3=None try: ## saving node Index ## from Vision.StandardNodes import Index Index_4 = Index(constrkw = {}, name='Index', library=stdlib) masterNet.addNode(Index_4,375,137) apply(Index_4.inputPortByName['index'].widget.configure, (), {'max': 3}) Index_4.inputPortByName['index'].widget.set(3, run=False) apply(Index_4.configure, (), {'expanded': True}) except: print "WARNING: failed to restore Index named Index in network masterNet" print_exc() Index_4=None try: ## saving node Plot ## from Vision.matplotlibNodes import PlotNE Plot_5 = PlotNE(constrkw = {}, name='Plot', library=matplotliblib) masterNet.addNode(Plot_5,211,331) Plot_5.inputPortByName['color'].widget.set("blue", run=False) Plot_5.inputPortByName['line_linewidth'].widget.set(2.28333333333, run=False) apply(Plot_5.configure, (), {'expanded': True}) except: print "WARNING: failed to restore PlotNE named Plot in network masterNet" print_exc() Plot_5=None try: ## saving node Draw Area ## from Vision.matplotlibNodes import MPLDrawAreaNE Draw_Area_6 = MPLDrawAreaNE(constrkw = {}, name='Draw Area', library=matplotliblib) masterNet.addNode(Draw_Area_6,208,263) Draw_Area_6.inputPortByName['left'].widget.set(0.2, run=False) Draw_Area_6.inputPortByName['bottom'].widget.set(0.6, run=False) Draw_Area_6.inputPortByName['width'].widget.set(0.2, run=False) Draw_Area_6.inputPortByName['height'].widget.set(0.2, run=False) Draw_Area_6.inputPortByName['title'].widget.set("Impulse Response", run=False) Draw_Area_6.inputPortByName['xlabel'].widget.set("", run=False) Draw_Area_6.inputPortByName['ylabel'].widget.set("", run=False) Draw_Area_6.inputPortByName['xticklabels'].widget.set(0, run=False) Draw_Area_6.inputPortByName['yticklabels'].widget.set(0, run=False) except: print "WARNING: failed to restore MPLDrawAreaNE named Draw Area in network masterNet" print_exc() Draw_Area_6=None try: ## saving node Set Matplotlib options ## from Vision.matplotlibNodes import MatPlotLibOptions Set_Matplotlib_options_7 = MatPlotLibOptions(constrkw = {}, name='Set Matplotlib options', library=matplotliblib) masterNet.addNode(Set_Matplotlib_options_7,332,262) Set_Matplotlib_options_7.inputPortByName['matplotlibOptions'].widget.set({'ytick.color': 'black', 'figpatch_facecolor': 'darkgray', 'facecolor': 'yellow', 'xtick.color': 'black', 'markeredgewidth': 0.0, 'xtick.labelrotation': 0, 'xtick.major.pad': 3, 'xtick.minor.pad': 3}, run=False) except: print "WARNING: failed to restore MatPlotLibOptions named Set Matplotlib options in network masterNet" print_exc() Set_Matplotlib_options_7=None try: ## saving node Figure ## from Vision.matplotlibNodes import MPLFigureNE Figure_8 = MPLFigureNE(constrkw = {}, name='Figure', library=matplotliblib) masterNet.addNode(Figure_8,231,458) Figure_8.inputPortByName['packOpts'].widget.set("{'side':'top', 'fill':'both', 'expand':1}", run=False) except: print "WARNING: failed to restore MPLFigureNE named Figure in network masterNet" print_exc() Figure_8=None try: ## saving node Plot ## from Vision.matplotlibNodes import PlotNE Plot_9 = PlotNE(constrkw = {}, name='Plot', library=matplotliblib) masterNet.addNode(Plot_9,17,330) Plot_9.inputPortByName['color'].widget.set("blue", run=False) apply(Plot_9.configure, (), {'expanded': True}) except: print "WARNING: failed to restore PlotNE named Plot in network masterNet" print_exc() Plot_9=None try: ## saving node Draw Area ## from Vision.matplotlibNodes import MPLDrawAreaNE Draw_Area_10 = MPLDrawAreaNE(constrkw = {}, name='Draw Area', library=matplotliblib) masterNet.addNode(Draw_Area_10,56,274) Draw_Area_10.inputPortByName['title'].widget.set("Gaussian colored noise", run=False) Draw_Area_10.inputPortByName['xlabel'].widget.set("time(s)", run=False) Draw_Area_10.inputPortByName['ylabel'].widget.set("current(nA)", run=False) Draw_Area_10.inputPortByName['xlimit'].widget.set("[0,1]", run=False) Draw_Area_10.inputPortByName['ylimit'].widget.set("[-.02,0.035]", run=False) Draw_Area_10.inputPortByName['autoscaleon'].widget.set(0, run=False) except: print "WARNING: failed to restore MPLDrawAreaNE named Draw Area in network masterNet" print_exc() Draw_Area_10=None try: ## saving node Histogram ## from Vision.matplotlibNodes import HistogramNE Histogram_11 = HistogramNE(constrkw = {}, name='Histogram', library=matplotliblib) masterNet.addNode(Histogram_11,391,322) Histogram_11.inputPortByName['bins'].widget.set(400, run=False) apply(Histogram_11.configure, (), {'expanded': True}) except: print "WARNING: failed to restore HistogramNE named Histogram in network masterNet" print_exc() Histogram_11=None try: ## saving node Draw Area ## from Vision.matplotlibNodes import MPLDrawAreaNE Draw_Area_12 = MPLDrawAreaNE(constrkw = {}, name='Draw Area', library=matplotliblib) masterNet.addNode(Draw_Area_12,553,262) Draw_Area_12.inputPortByName['left'].widget.set(0.65, run=False) Draw_Area_12.inputPortByName['bottom'].widget.set(0.6, run=False) Draw_Area_12.inputPortByName['width'].widget.set(0.2, run=False) Draw_Area_12.inputPortByName['height'].widget.set(0.2, run=False) Draw_Area_12.inputPortByName['title'].widget.set("Probability", run=False) Draw_Area_12.inputPortByName['xlabel'].widget.set("", run=False) Draw_Area_12.inputPortByName['ylabel'].widget.set("", run=False) Draw_Area_12.inputPortByName['xticklabels'].widget.set(0, run=False) Draw_Area_12.inputPortByName['yticklabels'].widget.set(0, run=False) except: print "WARNING: failed to restore MPLDrawAreaNE named Draw Area in network masterNet" print_exc() Draw_Area_12=None masterNet.freeze() ## saving connections for network Axes ## if ReadTable_0 is not None and Index_1 is not None: try: masterNet.connectNodes( ReadTable_0, Index_1, "data", "data", blocking=True) except: print "WARNING: failed to restore connection between ReadTable_0 and Index_1 in network masterNet" if ReadTable_0 is not None and Index_2 is not None: try: masterNet.connectNodes( ReadTable_0, Index_2, "data", "data", blocking=True) except: print "WARNING: failed to restore connection between ReadTable_0 and Index_2 in network masterNet" if ReadTable_0 is not None and Index_3 is not None: try: masterNet.connectNodes( ReadTable_0, Index_3, "data", "data", blocking=True) except: print "WARNING: failed to restore connection between ReadTable_0 and Index_3 in network masterNet" if ReadTable_0 is not None and Index_4 is not None: try: masterNet.connectNodes( ReadTable_0, Index_4, "data", "data", blocking=True) except: print "WARNING: failed to restore connection between ReadTable_0 and Index_4 in network masterNet" if Index_4 is not None and Plot_5 is not None: try: masterNet.connectNodes( Index_4, Plot_5, "data", "y", blocking=True) except: print "WARNING: failed to restore connection between Index_4 and Plot_5 in network masterNet" if Draw_Area_6 is not None and Plot_5 is not None: try: masterNet.connectNodes( Draw_Area_6, Plot_5, "drawAreaDef", "drawAreaDef", blocking=True) except: print "WARNING: failed to restore connection between Draw_Area_6 and Plot_5 in network masterNet" if Set_Matplotlib_options_7 is not None and Plot_5 is not None: try: masterNet.connectNodes( Set_Matplotlib_options_7, Plot_5, "matplotlibOptions", "drawAreaDef", blocking=True) except: print "WARNING: failed to restore connection between Set_Matplotlib_options_7 and Plot_5 in network masterNet" if Index_3 is not None and Plot_5 is not None: try: masterNet.connectNodes( Index_3, Plot_5, "data", "x", blocking=True) except: print "WARNING: failed to restore connection between Index_3 and Plot_5 in network masterNet" if Index_1 is not None and Plot_9 is not None: try: masterNet.connectNodes( Index_1, Plot_9, "data", "x", blocking=True) except: print "WARNING: failed to restore connection between Index_1 and Plot_9 in network masterNet" if Index_2 is not None and Plot_9 is not None: try: masterNet.connectNodes( Index_2, Plot_9, "data", "y", blocking=True) except: print "WARNING: failed to restore connection between Index_2 and Plot_9 in network masterNet" if Draw_Area_10 is not None and Plot_9 is not None: try: masterNet.connectNodes( Draw_Area_10, Plot_9, "drawAreaDef", "drawAreaDef", blocking=True) except: print "WARNING: failed to restore connection between Draw_Area_10 and Plot_9 in network masterNet" if Index_2 is not None and Histogram_11 is not None: try: masterNet.connectNodes( Index_2, Histogram_11, "data", "values", blocking=True) except: print "WARNING: failed to restore connection between Index_2 and Histogram_11 in network masterNet" if Draw_Area_12 is not None and Histogram_11 is not None: try: masterNet.connectNodes( Draw_Area_12, Histogram_11, "drawAreaDef", "drawAreaDef", blocking=True) except: print "WARNING: failed to restore connection between Draw_Area_12 and Histogram_11 in network masterNet" if Set_Matplotlib_options_7 is not None and Histogram_11 is not None: try: masterNet.connectNodes( Set_Matplotlib_options_7, Histogram_11, "matplotlibOptions", "drawAreaDef", blocking=True) except: print "WARNING: failed to restore connection between Set_Matplotlib_options_7 and Histogram_11 in network masterNet" if Plot_9 is not None and Figure_8 is not None: try: masterNet.connectNodes( Plot_9, Figure_8, "plot", "plots", blocking=True) except: print "WARNING: failed to restore connection between Plot_9 and Figure_8 in network masterNet" if Histogram_11 is not None and Figure_8 is not None: try: masterNet.connectNodes( Histogram_11, Figure_8, "plot", "plots", blocking=True) except: print "WARNING: failed to restore connection between Histogram_11 and Figure_8 in network masterNet" if Plot_5 is not None and Figure_8 is not None: try: masterNet.connectNodes( Plot_5, Figure_8, "plot", "plots", blocking=True) except: print "WARNING: failed to restore connection between Plot_5 and Figure_8 in network masterNet" masterNet.unfreeze() #masterNet.run()