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

Method _on_reset

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

Source from the content-addressed store, hash-verified

2028 self.targetfig.canvas.draw()
2029
2030 def _on_reset(self, event):
2031 with ExitStack() as stack:
2032 # Temporarily disable drawing on self and self's sliders, and
2033 # disconnect slider events (as the subplotparams can be temporarily
2034 # invalid, depending on the order in which they are restored).
2035 stack.enter_context(cbook._setattr_cm(self, drawon=False))
2036 for slider in self._sliders:
2037 stack.enter_context(
2038 cbook._setattr_cm(slider, drawon=False, eventson=False))
2039 # Reset the slider to the initial position.
2040 for slider in self._sliders:
2041 slider.reset()
2042 if self.drawon:
2043 event.canvas.draw() # Redraw the subplottool canvas.
2044 self._on_slider_changed(None) # Apply changes to the target window.
2045
2046
2047class Cursor(AxesWidget):

Callers

nothing calls this directly

Calls 3

_on_slider_changedMethod · 0.95
resetMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected