MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / onmove

Method onmove

lib/matplotlib/widgets.py:2271–2301  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

2269 info["background"] = canvas.copy_from_bbox(canvas.figure.bbox)
2270
2271 def onmove(self, event):
2272 axs = [ax for ax in self.axes if ax.contains(event)[0]]
2273 if self.ignore(event) or not axs or not event.canvas.widgetlock.available(self):
2274 return
2275 ax = cbook._topmost_artist(axs)
2276 xdata, ydata = ((event.xdata, event.ydata) if event.inaxes is ax
2277 else ax.transData.inverted().transform((event.x, event.y)))
2278 for line in self.vlines:
2279 line.set_xdata((xdata, xdata))
2280 line.set_visible(self.visible and self.vertOn)
2281 for line in self.hlines:
2282 line.set_ydata((ydata, ydata))
2283 line.set_visible(self.visible and self.horizOn)
2284 if not (self.visible and (self.vertOn or self.horizOn)):
2285 return
2286 # Redraw.
2287 if self.useblit:
2288 for canvas, info in self._canvas_infos.items():
2289 if info["background"]:
2290 canvas.restore_region(info["background"])
2291 if self.vertOn:
2292 for ax, line in zip(self.axes, self.vlines):
2293 ax.draw_artist(line)
2294 if self.horizOn:
2295 for ax, line in zip(self.axes, self.hlines):
2296 ax.draw_artist(line)
2297 for canvas in self._canvas_infos:
2298 canvas.blit()
2299 else:
2300 for canvas in self._canvas_infos:
2301 canvas.draw_idle()
2302
2303
2304class _SelectorWidget(AxesWidget):

Callers

nothing calls this directly

Calls 12

availableMethod · 0.80
set_xdataMethod · 0.80
set_ydataMethod · 0.80
containsMethod · 0.45
ignoreMethod · 0.45
transformMethod · 0.45
invertedMethod · 0.45
set_visibleMethod · 0.45
restore_regionMethod · 0.45
draw_artistMethod · 0.45
blitMethod · 0.45
draw_idleMethod · 0.45

Tested by

no test coverage detected