Beispiel #1
0
 def _v_plot_default(self):
     plot = Plot(self.pd,
                 orientation="v",
                 resizable="v",
                 padding=20,
                 padding_bottom=160,
                 default_origin="top left")
     plot.height = 600
     plot.width = 100
     plot.plot(("v_index", "v_value"))
     return plot
Beispiel #2
0
 def _h_plot_default(self):
     plot = Plot(self.pd, resizable="h")
     plot.height = 100
     plot.padding = 20
     plot.plot(("h_index", "h_value"))
     return plot
    def _plot_default(self):
        outcomes, results, time = self._prepare_data()
        
        self.outcomes = outcomes
        self.time = time
        self.low = int(np.min(time))
        self.high = int(np.max(time))
        

        self.data = {}
        for outcome in outcomes:
            self.data[outcome] = results[outcome]
        
        # Create some data
        pd = ArrayPlotData()
        
        for entry in outcomes:
            if self.startValue == 'low':
                pd.set_data(entry, self.data[entry][:,0])
            elif self.startValue == 'high':
                pd.set_data(entry, self.data[entry][:,-1])
        self.plotdata = pd
        
#        outcomes = outcomes[0:3]

        container = GridContainer(shape=(len(outcomes),len(outcomes)))
        combis = [(field1, field2) for field1 in outcomes for field2 in outcomes]
        
        selectorTools = []
        for entry1, entry2 in combis:

            # Create the plot
            if entry1 == entry2:
                plot = Plot(pd)
            else:
                plot = Plot(pd)
                
                #set limits for x and y to global limits
                plot.range2d._xrange._high_setting = np.max(self.data[entry1])
                plot.range2d._xrange._high_value = np.max(self.data[entry1])
                plot.range2d._xrange._low_setting = np.min(self.data[entry1])
                plot.range2d._xrange._low_value = np.min(self.data[entry1])
                
                plot.range2d._yrange._high_setting =np.max(self.data[entry2])
                plot.range2d._yrange._high_value = np.max(self.data[entry2])
                plot.range2d._yrange._low_setting = np.min(self.data[entry2])
                plot.range2d._yrange._low_value = np.min(self.data[entry2])

                #make the scatter plot
                plot.plot((entry1, entry2),
                            type="scatter",
                            marker="circle",
                            color="blue",
                            marker_size=3,
                            bgcolor="white")[0]                
            
                tool = ScatterSelectorTool(component=plot)
                tool._index = entry1
                plot.tools.append(tool)
                selectorTools.append(tool)
            
            plot.height = 500
            plot.width = 500
            plot.border_width = 1
            plot.aspect_ratio  = 1.
            
            container.add(plot)
        
        for tool in selectorTools:
            tool._other_selectors = list(set(selectorTools) - set([tool]))
            tool._demo = self
        return container