コード例 #1
0
    def create(self, parent):
        # create a layout for the tab widget and the main view
        self.layout = layout = QtGui.QVBoxLayout()
        self.control = QtGui.QWidget()
        self.control.setLayout(layout)

        tabs_ui = self.model.edit_traits(view='plot_view',
                                         kind='subpanel',
                                         parent=parent)
        self.layout.addWidget(tabs_ui.control)

        # add the main plot
        self.canvas = FigureCanvasQTAggLocal(Figure(),
                                             self.model.child_matplotlib_conn)
        self.canvas.setSizePolicy(QtGui.QSizePolicy.Expanding,
                                  QtGui.QSizePolicy.Expanding)
        layout.addWidget(self.canvas)
コード例 #2
0
class FlowTaskPane(TaskPane):
    """
    The center pane for the UI; contains the matplotlib canvas for plotting
    data views.
    """

    id = 'edu.mit.synbio.cytoflow.flow_task_pane'
    name = 'Cytometry Data Viewer'

    layout = Instance(QtGui.QVBoxLayout)  # @UndefinedVariable
    canvas = Instance(FigureCanvasQTAggLocal)

    def create(self, parent):
        if self.canvas is not None:
            return

        # create a layout for the tab widget and the main view
        self.layout = layout = QtGui.QVBoxLayout()  # @UndefinedVariable
        self.control = QtGui.QWidget()  # @UndefinedVariable
        self.control.setLayout(layout)

        tabs_ui = self.model.edit_traits(view='plot_view',
                                         kind='subpanel',
                                         parent=parent)
        self.layout.addWidget(tabs_ui.control)

        # add the main plot
        self.canvas = FigureCanvasQTAggLocal(Figure(),
                                             self.model.child_matplotlib_conn)
        self.canvas.setSizePolicy(
            QtGui.QSizePolicy.Expanding,  # @UndefinedVariable
            QtGui.QSizePolicy.Expanding)  # @UndefinedVariable
        layout.addWidget(self.canvas)

    def destroy(self):
        pass


#         self.layout = self.control = None

    def export(self, filename, **kwargs):
        self.canvas.print_figure(filename, bbox_inches='tight', **kwargs)
コード例 #3
0
class FlowTaskPane(TaskPane):
    """
    The center pane for the UI; contains the matplotlib canvas for plotting
    data views.  eventually, this will allow multiple views; for now, it's
    just one matplotlib canvas.
    """

    id = 'edu.mit.synbio.cytoflow.flow_task_pane'
    name = 'Cytometry Data Viewer'

    layout = Instance(QtGui.QVBoxLayout)
    canvas = Instance(FigureCanvasQTAggLocal)

    def create(self, parent):
        # create a layout for the tab widget and the main view
        self.layout = layout = QtGui.QVBoxLayout()
        self.control = QtGui.QWidget()
        self.control.setLayout(layout)

        tabs_ui = self.model.edit_traits(view='plot_view',
                                         kind='subpanel',
                                         parent=parent)
        self.layout.addWidget(tabs_ui.control)

        # add the main plot
        self.canvas = FigureCanvasQTAggLocal(Figure(),
                                             self.model.child_matplotlib_conn)
        self.canvas.setSizePolicy(QtGui.QSizePolicy.Expanding,
                                  QtGui.QSizePolicy.Expanding)
        layout.addWidget(self.canvas)

    def destroy(self):
        self.layout = self.control = None

    def export(self, filename):
        # TODO - eventually give a preview, allow changing size, dpi, aspect
        # ratio, plot layout, etc.  at the moment, just export exactly what's
        # on the screen

        self.canvas.print_figure(filename, bbox_inches='tight')
コード例 #4
0
 def create(self, parent):
     if self.canvas is not None:
         return
     
     # create a layout for the tab widget and the main view
     self.layout = layout = QtGui.QVBoxLayout()          # @UndefinedVariable
     self.control = QtGui.QWidget()                      # @UndefinedVariable
     self.control.setLayout(layout)
     
     tabs_ui = self.model.edit_traits(view = 'plot_view',
                                      kind = 'subpanel',
                                      parent = parent)
     self.layout.addWidget(tabs_ui.control) 
     
     # add the main plot
     self.canvas = FigureCanvasQTAggLocal(Figure(), 
                                          self.model.child_matplotlib_conn, 
                                          self.waiting_image.create_image(size = (1000, 1000)))
     self.canvas.setSizePolicy(QtGui.QSizePolicy.Expanding,  # @UndefinedVariable
                               QtGui.QSizePolicy.Expanding)  # @UndefinedVariable
     
     layout.addWidget(self.canvas)
コード例 #5
0
class FlowTaskPane(TaskPane):
    """
    The center pane for the UI; contains the matplotlib canvas for plotting
    data views.  eventually, this will allow multiple views; for now, it's
    just one matplotlib canvas.
    """
    
    id = 'edu.mit.synbio.cytoflow.flow_task_pane'
    name = 'Cytometry Data Viewer'
    
    layout = Instance(QtGui.QVBoxLayout)
    canvas = Instance(FigureCanvasQTAggLocal)
        
    def create(self, parent):
        # create a layout for the tab widget and the main view
        self.layout = layout = QtGui.QVBoxLayout()
        self.control = QtGui.QWidget()
        self.control.setLayout(layout)
        
        tabs_ui = self.model.edit_traits(view = 'plot_view',
                                         kind = 'subpanel',
                                         parent = parent)
        self.layout.addWidget(tabs_ui.control) 
        
        # add the main plot
        self.canvas = FigureCanvasQTAggLocal(Figure())
        self.canvas.setSizePolicy(QtGui.QSizePolicy.Expanding,
                                  QtGui.QSizePolicy.Expanding)
        layout.addWidget(self.canvas)

    def destroy(self):
        self.layout = self.control = None 
                  
    def export(self, filename):
        # TODO - eventually give a preview, allow changing size, dpi, aspect 
        # ratio, plot layout, etc.  at the moment, just export exactly what's
        # on the screen
        
        self.canvas.print_figure(filename, bbox_inches = 'tight')
コード例 #6
0
 def create(self, parent):
     # create a layout for the tab widget and the main view
     self.layout = layout = QtGui.QVBoxLayout()
     self.control = QtGui.QWidget()
     self.control.setLayout(layout)
     
     tabs_ui = self.model.edit_traits(view = 'plot_view',
                                      kind = 'subpanel',
                                      parent = parent)
     self.layout.addWidget(tabs_ui.control) 
     
     # add the main plot
     self.canvas = FigureCanvasQTAggLocal(Figure())
     self.canvas.setSizePolicy(QtGui.QSizePolicy.Expanding,
                               QtGui.QSizePolicy.Expanding)
     layout.addWidget(self.canvas)