Skip to content

Commit

Permalink
Update docstring of ginput
Browse files Browse the repository at this point in the history
  • Loading branch information
timhoffm committed Sep 23, 2018
1 parent 7c24848 commit 5f29877
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -2181,11 +2181,20 @@ def ginput(self, n=1, timeout=30, show_clicks=True, mouse_add=1,
Wait until the user clicks *n* times on the figure, and return the
coordinates of each click in a list.
The buttons used for the various actions (adding points, removing
points, terminating the inputs) can be overridden via the arguments
*mouse_add*, *mouse_pop* and *mouse_stop*, that set the associated
mouse button: 1 for left, 2 for middle, 3 for right. Using a different
value (e.g. None) disables the corresponding mouse action.
There are three possible interactions:
- Add a point.
- Remove the most recently added point.
- Stop the interaction and return the points added so far.
The actions are assigned to mouse buttons via the arguments
*mouse_add*, *mouse_pop* and *mouse_stop*. Mouse buttons are defined
by the numbers:
- 1: left mouse button
- 2: middle mouse button
- 3: right mouse button
- None: no mouse button
Parameters
----------
Expand All @@ -2197,11 +2206,11 @@ def ginput(self, n=1, timeout=30, show_clicks=True, mouse_add=1,
will never timeout.
show_clicks : bool, optional, default: False
If True, show a red cross at the location of each click.
mouse_add : int, one of (1, 2, 3), optional, default: 1 (left click)
mouse_add : {1, 2, 3, None}, optional, default: 1 (left click)
Mouse button used to add points.
mouse_pop : int, one of (1, 2, 3), optional, default: 3 (right click)
mouse_pop : {1, 2, 3, None}, optional, default: 3 (right click)
Mouse button used to remove the most recently added point.
mouse_stop : int, one of (1, 2, 3), optional, default: 2 (middle click)
mouse_stop : {1, 2, 3, None}, optional, default: 2 (middle click)
Mouse button used to stop input.
Returns
Expand Down

0 comments on commit 5f29877

Please sign in to comment.