本文整理汇总了Python中matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.deleteLater方法的典型用法代码示例。如果您正苦于以下问题:Python FigureCanvasQTAgg.deleteLater方法的具体用法?Python FigureCanvasQTAgg.deleteLater怎么用?Python FigureCanvasQTAgg.deleteLater使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg
的用法示例。
在下文中一共展示了FigureCanvasQTAgg.deleteLater方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: deleteLater
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import deleteLater [as 别名]
def deleteLater(self, *args):
self.delete()
return FigureCanvasQTAgg.deleteLater(self, *args)
示例2: Main
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import deleteLater [as 别名]
#.........这里部分代码省略.........
if self.auto_flag:
self.ax1.relim()
self.ax1.autoscale_view(True, True, True)
elif self.BoreView == 'Z':
self.im.set_ydata(self.X.data[self.Scroll_Vert.value(), self.Scroll_Horz.value(), :][::])
if self.auto_flag:
self.ax1.relim()
self.ax1.autoscale_view(True, True, True)
elif self.AverageBore.isChecked():
self.Scroll_Horz.setValue(self.ind)
self.Scroll_Vert.setValue(self.ind)
# try and redraw
try:
self.im.axes.figure.canvas.draw()
if self.auto_flag:
self.im.autoscale()
except AttributeError:
pass
def addmpl(self):
# add plot to anvas
self.rmmpl()
self.canvas = FigureCanvas(self.fig)
self.mplvl.addWidget(self.canvas)
self.canvas.draw()
self.toolbar = NavigationToolbar(self.canvas, self.mplwindow)
self.mplvl.addWidget(self.toolbar)
def rmmpl(self):
# delete plot from canvas
try:
self.canvas.close()
self.canvas.deleteLater()
self.toolbar.close()
self.toolbar.deleteLater()
gc.collect()
except:
pass
def saveBore(self,):
# save bore as a list of points
name = QtWidgets.QFileDialog.getSaveFileName(self, 'Save File')
f = open(name, 'w')
if len(self.ave) > 1:
for i in range(len(self.ave)):
f.write(str(self.ave[i]) + '\n')
f.close()
else:
if self.BoreView == "X":
tmp = self.X[:, self.Scroll_Horz.value(), self.Scroll_Vert.value()]
elif self.BoreView == "Y":
tmp = self.X[self.Scroll_Horz.value(), :, self.Scroll_Vert.value()]
elif self.BoreView == "Z":
tmp = self.X[self.Scroll_Horz.value(), self.Scroll_Vert.value(), :]
for i in range(len(tmp)):
f.write(str(tmp[i]) + '\n')
def file_open(self, args):
self.reset_plot()
while True:
try:
# get file name