本文整理汇总了Python中matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.mpl_disconnect方法的典型用法代码示例。如果您正苦于以下问题:Python FigureCanvasQTAgg.mpl_disconnect方法的具体用法?Python FigureCanvasQTAgg.mpl_disconnect怎么用?Python FigureCanvasQTAgg.mpl_disconnect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg
的用法示例。
在下文中一共展示了FigureCanvasQTAgg.mpl_disconnect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Calibrlogger
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import mpl_disconnect [as 别名]
#.........这里部分代码省略.........
@fn_timer
def reset_plot_selects_and_calib_help(self):
""" Reset self.cid and self.calib_help """
self.reset_cid()
self.log_pos = None
self.y_pos = None
self.calib_help.setText("")
@fn_timer
def reset_settings(self):
self.ToDateTime.setDateTime(datestring_to_date('2099-12-31 23:59:59'))
self.Add2Levelmasl.setText('')
self.bestFitSearchRadius.setText('10 minutes')
#self.mpltoolbar.home()
last_calibration = self.getlastcalibration(self.obsid)
try:
if last_calibration[0][1] and last_calibration[0][0]:
self.LoggerPos.setText(str(last_calibration[0][1]))
self.FromDateTime.setDateTime(datestring_to_date(last_calibration[0][0]))
else:
self.LoggerPos.setText('')
self.FromDateTime.setDateTime(datestring_to_date('2099-12-31 23:59:59'))
except Exception as e:
utils.MessagebarAndLog.info(log_msg=ru(QCoreApplication.translate('Calibrlogger', 'Getting last calibration failed for obsid %s, msg: %s'))%(self.obsid, str(e)))
self.LoggerPos.setText('')
self.FromDateTime.setDateTime(datestring_to_date('2099-12-31 23:59:59'))
@fn_timer
def reset_cid(self):
""" Resets self.cid to an empty list and disconnects unused events """
for x in self.cid:
self.canvas.mpl_disconnect(x)
self.cid = []
@fn_timer
def catch_old_level(self):
"""Part of adjustment method 3. adjust level_masl by clicking in plot.
this part selects a line node and a y-position on the plot"""
#Run init to make sure self.meas_ts and self.head_ts is updated for the current obsid.
self.load_obsid_and_init()
self.deactivate_pan_zoom()
self.canvas.setFocusPolicy(Qt.ClickFocus)
self.canvas.setFocus()
self.calib_help.setText(ru(QCoreApplication.translate('Calibrlogger', "Select a logger node.")))
self.cid.append(self.canvas.mpl_connect('pick_event', self.set_log_pos_from_node_date_click))
@fn_timer
def catch_new_level(self):
""" Part of adjustment method 3. adjust level_masl by clicking in plot.
this part selects a y-position from the plot (normally user would select a manual measurement)."""
if self.log_pos is not None:
self.calib_help.setText(ru(QCoreApplication.translate('Calibrlogger', "Select a y position to move to.")))
self.cid.append(self.canvas.mpl_connect('button_press_event', self.set_y_pos_from_y_click))
self.calib_help.setText("")
else:
self.calib_help.setText(ru(QCoreApplication.translate('Calibrlogger', "Something wrong, click \"Current\" and try again.")))
@fn_timer
def calculate_offset(self):
""" Part of adjustment method 3. adjust level_masl by clicking in plot.
this method extracts the head from head_ts with the same date as the line node.
4. Calculating y-position - head (or level_masl) and setting self.LoggerPos.
5. Run calibration.