1234567891011121314151617181920212223 |
- def plotFigure2D(workspace):
- """GUI layout for plot figure
- Arguments:
- workspace {QtWidgets.QWidget} -- main layout
- Returns:
- layout {QtWidgets.QVBoxLayout} -- contains matplot figure
- """
- workspace.figure2D = Figure()
- workspace.canvas2D = FigureCanvas(workspace.figure2D)
- # workspace.figure2D.patch.set_facecolor('white')
- class NavigationCustomToolbar(NavigationToolbar):
- toolitems = [t for t in NavigationToolbar.toolitems if t[0] in ()]
- workspace.toolbar2D = NavigationCustomToolbar(workspace.canvas2D, workspace)
- layout = QVBoxLayout()
- layout.addWidget(workspace.canvas2D)
- layout.addWidget(workspace.toolbar2D)
- return layout
|