本文整理汇总了Python中guiqwt.plot.PlotManager.add_panel方法的典型用法代码示例。如果您正苦于以下问题:Python PlotManager.add_panel方法的具体用法?Python PlotManager.add_panel怎么用?Python PlotManager.add_panel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类guiqwt.plot.PlotManager
的用法示例。
在下文中一共展示了PlotManager.add_panel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: CentralWidget
# 需要导入模块: from guiqwt.plot import PlotManager [as 别名]
# 或者: from guiqwt.plot.PlotManager import add_panel [as 别名]
class CentralWidget(QWidget):
def __init__(self, parent):
QWidget.__init__(self, parent)
layout = QGridLayout()
self.setLayout(layout)
self.plot1 = ImagePlot(self)
layout.addWidget(self.plot1, 0, 0, 1, 1)
self.plot2 = ImagePlot(self)
layout.addWidget(self.plot2, 1, 0, 1, 1)
self.contrast = ContrastAdjustment(self)
layout.addWidget(self.contrast, 2, 0, 1, 2)
self.itemlist = PlotItemList(self)
layout.addWidget(self.itemlist, 0, 1, 2, 1)
self.manager = PlotManager(self)
for plot in (self.plot1, self.plot2):
self.manager.add_plot(plot)
for panel in (self.itemlist, self.contrast):
self.manager.add_panel(panel)
def register_tools(self):
self.manager.register_all_image_tools()
示例2: Window
# 需要导入模块: from guiqwt.plot import PlotManager [as 别名]
# 或者: from guiqwt.plot.PlotManager import add_panel [as 别名]
class Window(QMainWindow):
def __init__(self, wintitle):
super(Window, self).__init__()
self.default_tool = None
self.plots = []
self.itemlist = PlotItemList(None)
self.contrast = ContrastAdjustment(None)
self.xcsw = XCrossSection(None)
self.ycsw = YCrossSection(None)
self.manager = PlotManager(self)
self.toolbar = QToolBar(_("Tools"), self)
self.manager.add_toolbar(self.toolbar, "default")
self.toolbar.setMovable(True)
self.toolbar.setFloatable(True)
self.addToolBar(Qt.TopToolBarArea, self.toolbar)
frame = QFrame(self)
self.setCentralWidget(frame)
self.layout = QGridLayout()
layout = QVBoxLayout(frame)
frame.setLayout(layout)
layout.addLayout(self.layout)
self.frame = frame
self.setWindowTitle(wintitle)
self.setWindowIcon(get_icon('guiqwt.svg'))
def closeEvent(self, event):
global _figures, _current_fig, _current_axes
figure_title = to_text_string(self.windowTitle())
if _figures.pop(figure_title) == _current_fig:
_current_fig = None
_current_axes = None
self.itemlist.close()
self.contrast.close()
self.xcsw.close()
self.ycsw.close()
event.accept()
def add_plot(self, i, j, plot):
self.layout.addWidget(plot, i, j)
self.manager.add_plot(plot)
self.plots.append(plot)
def replot(self):
for plot in self.plots:
plot.replot()
item = plot.get_default_item()
if item is not None:
plot.set_active_item(item)
item.unselect()
def add_panels(self, images=False):
self.manager.add_panel(self.itemlist)
if images:
for panel in (self.ycsw, self.xcsw, self.contrast):
panel.hide()
self.manager.add_panel(panel)
def register_tools(self, images=False):
if images:
self.manager.register_all_image_tools()
else:
self.manager.register_all_curve_tools()
def display(self):
self.show()
self.replot()
self.manager.get_default_tool().activate()
self.manager.update_tools_status()