plotter_7.py 708 B

1234567891011121314151617181920212223
  1. def plotFigure2D(workspace):
  2. """GUI layout for plot figure
  3. Arguments:
  4. workspace {QtWidgets.QWidget} -- main layout
  5. Returns:
  6. layout {QtWidgets.QVBoxLayout} -- contains matplot figure
  7. """
  8. workspace.figure2D = Figure()
  9. workspace.canvas2D = FigureCanvas(workspace.figure2D)
  10. # workspace.figure2D.patch.set_facecolor('white')
  11. class NavigationCustomToolbar(NavigationToolbar):
  12. toolitems = [t for t in NavigationToolbar.toolitems if t[0] in ()]
  13. workspace.toolbar2D = NavigationCustomToolbar(workspace.canvas2D, workspace)
  14. layout = QVBoxLayout()
  15. layout.addWidget(workspace.canvas2D)
  16. layout.addWidget(workspace.toolbar2D)
  17. return layout