Beispiel #1
0
    def _plot_default(self):
        plotter = Plot(data=self.data)
        main_plot = plotter.plot(['x','y'])[0]
        aoeu = plotter.plot(['x','y2'])
        print(dir(plotter))
        self.configure_plot(main_plot, self.x, self.y[0], xlabel='')
        self.configure_plot(aoeu[0], self.x, self.y[1], xlabel='')

        plotter2 = Plot(data=self.data)
        zoom_plot = plotter2.plot(['x','y'])[0]
        self.configure_plot(zoom_plot, self.x, self.y[0])
       
        
        outer_container = VPlotContainer(padding=20,
                                         fill_padding=True,
                                         spacing=0,
                                         stack_order='top_to_bottom',
                                         bgcolor='lightgray',
                                         use_backbuffer=True)


        outer_container.add(plotter)
        outer_container.add(plotter2)
        # FIXME: This is set to the windows bg color.  Should get from the system.
        #outer_container.bgcolor = (236/255., 233/255., 216/255., 1.0)

        plotter.controller = RangeSelection(plotter)
        
        zoom_overlay = ZoomOverlay(source=main_plot, destination=zoom_plot)
        outer_container.overlays.append(zoom_overlay)



        return outer_container
Beispiel #2
0
    def _stackedhist_default(self):
        plot = Plot(self.stackedhist_data, padding=(25, 0, 5, 20))
        plot_selected = plot.plot(('index', 'selected'), type='bar', bar_width=1, fill_color='red', line_color='red')
        plot_parkinson = plot.plot(('index', 'positives'), type='bar', bar_width=0.5, fill_color='yellow', line_color='yellow')
        plot_control = plot.plot(('index', 'negatives'), name="select", type='bar', bar_width=0.5, fill_color='blue', line_color='blue')

        # set the plot's value low range to 0, otherwise it will pad too much
        plot.value_range = DataRange1D(low_settings=0)

        legend = Legend(component=plot, padding=5, align='ur',
                        plots={'Control': plot_control, 'Parkinson': plot_parkinson})
        plot.overlays.append(legend)
        #return plot

        zoomplot = Plot(self.stackedhist_data, padding=(25, 0, 5, 20))
        zoomplot_selected = zoomplot.plot(('index', 'selected'), type='bar', bar_width=1, fill_color='red', line_color='red')
        zoomplot_parkinson = zoomplot.plot(('index', 'positives'), type='bar', bar_width=0.5, fill_color='yellow', line_color='yellow')
        zoomplot_control = zoomplot.plot(('index', 'negatives'), type='bar', bar_width=0.5, fill_color='blue', line_color='blue')

        zoomplot.value_range = DataRange1D(low_settings=0)
        zoomplot.index_axis.title = "Class count / patch"

        outer_container = VPlotContainer(padding=20,
                                         fill_padding=True,
                                         spacing=0,
                                         stack_order='top_to_bottom',
                                         bgcolor='lightgray',
                                         use_backbuffer=True)

        plot.index = plot_control[0].index

        outer_container.add(plot)
        outer_container.add(zoomplot)
        plot.controller = RangeSelection(plot)
        zoom_overlay = ZoomOverlay(source=plot, destination=zoomplot)
        outer_container.overlays.append(zoom_overlay)

        return outer_container