8000 Add some param docs to BlockingInput methods · matplotlib/matplotlib@1c34835 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1c34835

Browse files
committed
Add some param docs to BlockingInput methods
1 parent 50aebe6 commit 1c34835

File tree

1 file changed

+41
-5
lines changed

1 file changed

+41
-5
lines changed

lib/matplotlib/blocking_input.py

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,26 @@ def key_event(self):
155155
self.mouse_event_add(event)
156156

157157
def mouse_event_add(self, event):
158-
"""Process an button-1 event (add a click if inside axes)."""
158+
"""
159+
Process an button-1 event (add a click if inside axes).
160+
161+
Parameters
162+
----------
163+
event : ~.backend_bases.MouseEvent
164+
"""
159165
if event.inaxes:
160166
self.add_click(event)
161167
else: # If not a valid click, remove from event list.
162168
BlockingInput.pop(self)
163169

164170
def mouse_event_stop(self, event):
165-
"""Process an button-2 event (end blocking input)."""
171+
"""
172+
Process an button-2 event (end blocking input).
173+
174+
Parameters
175+
----------
176+
event : ~.backend_bases.MouseEvent
177+
"""
166178
# Remove last event just for cleanliness.
167179
BlockingInput.pop(self)
168180
# This will exit even if not in infinite mode. This is consistent with
@@ -171,15 +183,27 @@ def mouse_event_stop(self, event):
171183
self.fig.canvas.stop_event_loop()
172184

173185
def mouse_event_pop(self, event):
174-
"""Process an button-3 event (remove the last click)."""
186+
"""
187+
Process an button-3 event (remove the last click).
188+
189+
Parameters
190+
----------
191+
event : ~.backend_bases.MouseEvent
192+
"""
175193
# Remove this last event.
176194
BlockingInput.pop(self)
177195
# Now remove any existing clicks if possible.
178196
if self.events:
179197
self.pop(event)
180198

181199
def add_click(self, event):
182-
"""Add the coordinates of an event to the list of clicks."""
200+
"""
201+
Add the coordinates of an event to the list of clicks.
202+
203+
Parameters
204+
----------
205+
event : ~.backend_bases.MouseEvent
206+
"""
183207
self.clicks.append((event.xdata, event.ydata))
184208
_log.info("input %i: %f, %f",
185209
len(self.clicks), event.xdata, event.ydata)
@@ -192,7 +216,13 @@ def add_click(self, event):
192216
self.fig.canvas.draw()
193217

194218
def pop_click(self, event, index=-1):
195-
"""Remove a click (by default, the last) from the list of clicks."""
219+
"""
220+
Remove a click (by default, the last) from the list of clicks.
221+
222+
Parameters
223+
----------
224+
event : ~.backend_bases.MouseEvent
225+
"""
196226
self.clicks.pop(index)
197227
if self.show_clicks:
198228
self.marks.pop(index).remove()
@@ -208,6 +238,12 @@ def pop(self, event, index=-1):
208238
BlockingInput.pop(self, index)
209239

210240
def cleanup(self, event=None):
241+
"""
242+
Parameters
243+
----------
244+
event : ~.backend_bases.MouseEvent
245+
Not used
246+
"""
211247
# Clean the figure.
212248
if self.show_clicks:
213249
for mark in self.marks:

0 commit comments

Comments
 (0)
0