本文整理汇总了Python中guiqwt.plot.PlotManager.get_active_plot方法的典型用法代码示例。如果您正苦于以下问题:Python PlotManager.get_active_plot方法的具体用法?Python PlotManager.get_active_plot怎么用?Python PlotManager.get_active_plot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类guiqwt.plot.PlotManager
的用法示例。
在下文中一共展示了PlotManager.get_active_plot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: plotWindow
# 需要导入模块: from guiqwt.plot import PlotManager [as 别名]
# 或者: from guiqwt.plot.PlotManager import get_active_plot [as 别名]
#.........这里部分代码省略.........
# end addImagePlot
def addImageWidget(self, images, *args, **kwargs):
widget = ImageWidget(self, *args, **kwargs)
plot = widget.get_plot()
if (images.__class__ is not list):
plot.add_item(images)
else:
for image in images:
plot.add_item(image)
# end for
# end if
self.centralWidget().layout().addWidget(widget)
self.__l_layoutChilds.append(widget)
return widget
# end addImageWidget
def getManager(self):
return self.__p_manager
# end getManager
def __addPlot(self, dataList, plotClass, *args, **kwargs):
"""
pos[0]: row
pos[1]: column
pos[2]: rowspan
pos[3]: columnspan
"""
pos = []
if ('position' in kwargs):
pos = kwargs.pop('position')
# end if
if ('pos' in kwargs):
pos = kwargs.pop('pos')
# end if
plot = plotClass(self, *args, **kwargs)
if (dataList.__class__ is not list):
plot.add_item(dataList)
else:
for data in dataList:
plot.add_item(data)
# end for
# end if
self.__registerPlot(plot, pos)
return plot
# end __addPlot
def __registerPlot(self, plot, pos):
# check for position
if (pos != []):
if (len(pos) == 2):
pos.append(1) # rowspan
pos.append(1) # columnspan
# end if
self.centralWidget().layout().addWidget(plot, pos[0], pos[1], pos[2], pos[3])
else:
self.centralWidget().layout().addWidget(plot)
# end if
self.__l_layoutChilds.append(plot)
self.__p_manager.add_plot(plot)
# end __registerPLot
def show(self, *args, **kwargs):
if (self.__v_wasInitialized):
self.__p_manager.register_all_curve_tools()
self.__v_wasInitialized = False
# end if
QMainWindow.show(self, *args, **kwargs)
# end show
def showEvent(self, event):
# emit signal
self.emit(SIGNAL("onShow()"))
# execute not overloaded showEvent
QMainWindow.showEvent(self, event)
# end showEvent
def closeEvent(self, event):
# emit signal
self.emit(SIGNAL("onClose()"))
# execute not overloaded closeEvent
QMainWindow.closeEvent(self, event)
# end closeEvent
def __onAutoScale(self):
plot = self.__p_manager.get_active_plot()
plot.do_autoscale(True)