def setup_figure(self):
# Figure
fig = Figure((8.0, 6.0), dpi=90, facecolor=FIG_FACECOLOR)
canvas = FigureCanvas(fig)
canvas.setSizePolicy(
QtWidgets.QSizePolicy.Expanding,
QtWidgets.QSizePolicy.Expanding
)
canvas.setFocusPolicy( Qt.ClickFocus )
canvas.setFocus() # put last?
toolbar = NavigationToolbar(canvas, parent=self)
# Since we have only one plot, we can use add_axes
# instead of add_subplot, but then the subplot
# configuration tool in the navigation toolbar wouldn't
# work.
#
# self.axes = self.fig.add_subplot(111)
# self.axes = self.fig.axes
# Create the navigation toolbar, tied to the canvas
#
return fig, canvas, toolbar
# self.request_canvas_redraw()
评论列表
文章目录