本文整理汇总了Python中matplotlib.widgets.RectangleSelector.release方法的典型用法代码示例。如果您正苦于以下问题:Python RectangleSelector.release方法的具体用法?Python RectangleSelector.release怎么用?Python RectangleSelector.release使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.widgets.RectangleSelector
的用法示例。
在下文中一共展示了RectangleSelector.release方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_mouse_release
# 需要导入模块: from matplotlib.widgets import RectangleSelector [as 别名]
# 或者: from matplotlib.widgets.RectangleSelector import release [as 别名]
def on_mouse_release(self, event):
if event.button != 1:
return
if not self.ax.in_axes(event):
self.eventpress = None
return
RectangleSelector.release(self, event)
self._extents_on_press = None
# Undo hiding of rectangle and redraw.
self.set_visible(True)
self.redraw()
self.callback_on_release(self.geometry)
示例2: release
# 需要导入模块: from matplotlib.widgets import RectangleSelector [as 别名]
# 或者: from matplotlib.widgets.RectangleSelector import release [as 别名]
def release(self, ev):
if self.eventpress is None or self.ignore(ev):
return
if self.fixedSize and self.prevEvents:
# Panning mode. Modify the existing ROI. Do the shift.
ev.xdata += self.wdata
ev.ydata += self.hdata
self.eventpress.xdata = ev.xdata - 2 * self.wdata
self.eventpress.ydata = ev.ydata - 2 * self.hdata
self.prevEvents = (self.eventpress, ev)
pe, re = self.prevEvents
self.wdata = (pe.xdata - re.xdata) / 2
self.hdata = (pe.ydata - re.ydata) / 2
RectangleSelector.release(self, ev)