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)
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)
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')
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)
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')
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)