本文整理汇总了Python中matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg.destroy方法的典型用法代码示例。如果您正苦于以下问题:Python FigureCanvasQTAgg.destroy方法的具体用法?Python FigureCanvasQTAgg.destroy怎么用?Python FigureCanvasQTAgg.destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg
的用法示例。
在下文中一共展示了FigureCanvasQTAgg.destroy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Plot
# 需要导入模块: from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg import destroy [as 别名]
class Plot(Callback.Callbacks):
def __init__(self, logger):
Callback.Callbacks.__init__(self)
self.logger = logger
# For callbacks
for name in ('close', ):
self.enable_callback(name)
self.fig = matplotlib.figure.Figure()
self.ax = self.fig.add_subplot(111)
self.ax.set_xlabel('X values')
self.ax.set_ylabel('Y values')
self.ax.set_title('')
self.ax.grid(True)
self.canvas = FigureCanvas(self.fig)
def get_widget(self):
return self.canvas
def _sanity_check_window(self):
pass
def set_titles(self, xtitle=None, ytitle=None, title=None,
rtitle=None):
self._sanity_check_window()
if xtitle != None:
self.ax.set_xlabel(xtitle)
if ytitle != None:
self.ax.set_ylabel(ytitle)
if title != None:
self.ax.set_title(title)
if rtitle != None:
pass
def clear(self):
self._sanity_check_window()
self.logger.debug('clearing canvas...')
self.ax.cla()
def show(self):
self._sanity_check_window()
self.logger.debug('raising window...')
self.canvas.show()
def hide(self):
self._sanity_check_window()
self.logger.debug('hiding window...')
pass
def close(self):
self.logger.debug('closing window....')
self.canvas.destroy()
self.make_callback('close')
return False
def _draw(self):
self.fig.canvas.draw()
def plot(self, xarr, yarr, xtitle=None, ytitle=None, title=None,
rtitle=None, **kwdargs):
self.set_titles(xtitle=xtitle, ytitle=ytitle, title=title,
rtitle=rtitle)
self.ax.plot(xarr, yarr, **kwdargs)
self.ax.grid(True)
self._draw()
示例2: destroy
# 需要导入模块: from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg import destroy [as 别名]
def destroy(self, *args):
self.delete()
return FigureCanvasQTAgg.destroy(self, *args)