本文整理汇总了Python中matplotlib.backends.backend_qt5agg.NavigationToolbar2QT.setMovable方法的典型用法代码示例。如果您正苦于以下问题:Python NavigationToolbar2QT.setMovable方法的具体用法?Python NavigationToolbar2QT.setMovable怎么用?Python NavigationToolbar2QT.setMovable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.backends.backend_qt5agg.NavigationToolbar2QT
的用法示例。
在下文中一共展示了NavigationToolbar2QT.setMovable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.NavigationToolbar2QT import setMovable [as 别名]
def __init__(self):
super().__init__()
self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
self.setWindowTitle('Crossdiffusion PlotTool')
menu = QMenu('&Plot Type', self)
menu.addAction(types[0], self.typeEntropy, QtCore.Qt.Key_E)
menu.addAction(types[1], self.typeL2R, QtCore.Qt.Key_R)
menu.addAction(types[2], self.typeL2B, QtCore.Qt.Key_B)
self.menuBar().addMenu(menu)
self.main_widget = QWidget(self)
vlayout = QVBoxLayout(self.main_widget)
self.dc = MyMplCanvas(self.main_widget, width=5, height=4, dpi=100)
navtool = NavigationToolbar(self.dc, self)
navtool.setMovable(True)
self.addToolBar(navtool)
vlayout.addWidget(self.dc, 10)
grid = QGridLayout()
self.sOrder = TickLabelSlider([str(i) for i in valGrid[0]])
self.sMaxH = TickLabelSlider([str(i) for i in valGrid[1]])
self.sEta = TickLabelSlider([str(i) for i in valGrid[2]])
self.sliders = [self.sOrder, self.sMaxH, self.sEta]
grid.addWidget(self.sOrder, 1, 2, 1, 2)
grid.addWidget(self.sMaxH, 2, 2, 1, 2)
grid.addWidget(self.sEta, 3, 2, 1, 2)
for s in self.sliders:
s.valueChanged.connect(self.updatePlot)
vlayout.addLayout(grid, 3)
self.cbConv = QCheckBox('Conv')
self.cbDG = QCheckBox('DG')
self.cbConv.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
self.cbDG.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
self.cbConv.setChecked(False)
self.cbDG.setChecked(True)
grid.addWidget(self.cbConv, 2, 0,)
grid.addWidget(self.cbDG, 3, 0)
self.cbConv.toggled.connect(self.updatePlot)
self.cbDG.toggled.connect(self.updatePlot)
self.cbSimul = []
for i in range(3):
cb = QCheckBox()
# cb.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
grid.addWidget(cb, 1+i, 4)
cb.toggled.connect(self.updatePlot)
self.cbSimul.append(cb)
lblSimul = QLabel('all')
lblSimul.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
grid.addWidget(lblSimul, 0, 4)
for i in range(3):
lbl = QLabel(params[i])
lbl.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
grid.addWidget(lbl, 1+i, 1)
self.iType = 0
self.main_widget.setFocus()
self.setCentralWidget(self.main_widget)
self.updatePlot()