@@ -1827,24 +1827,41 @@ def subplots_adjust(self, *args, **kwargs):
1827
1827
def ginput (self , n = 1 , timeout = 30 , show_clicks = True , mouse_add = 1 ,
1828
1828
mouse_pop = 3 , mouse_stop = 2 ):
1829
1829
"""
1830
- Blocking call to interact with the figure.
1831
-
1832
- This will wait for *n* clicks from the user and return a list of the
1833
- coordinates of each click.
1834
-
1835
- If *timeout* is zero or negative, does not timeout.
1830
+ Blocking call to interact with a figure.
1836
1831
1837
- If *n* is zero or negative, accumulate clicks until a middle click
1838
- (or potentially both mouse buttons at once) terminates the input.
1839
-
1840
- Right clicking cancels last input.
1832
+ Wait until the user clicks *n* times on the figure, and return the
1833
+ coordinates of each click in a list.
1841
1834
1842
1835
The buttons used for the various actions (adding points, removing
1843
1836
points, terminating the inputs) can be overriden via the
1844
1837
arguments *mouse_add*, *mouse_pop* and *mouse_stop*, that give
1845
1838
the associated mouse button: 1 for left, 2 for middle, 3 for
1846
1839
right.
1847
1840
1841
+ Parameters
1842
+ ----------
1843
+ n : int, optional, default: 1
1844
+ Number of mouse clicks to accumulate. If negative, accumulate
1845
+ clicks until the input is terminated manually.
1846
+ timeout : scalar, optional, default: 30
1847
+ Number of seconds to wait before timing out. If zero or negative
1848
+ will never timeout.
1849
+ show_clicks : bool, optional, default: False
1850
+ If True, show a red cross at the location of each click.
1851
+ mouse_add : int, one of (1, 2, 3), optional, default: 1 (left click)
1852
+ Mouse button used to add points.
1853
+ mouse_pop : int, one of (1, 2, 3), optional, default: 3 (right click)
1854
+ Mouse button used to remove the most recently added point.
1855
+ mouse_stop : int, one of (1, 2, 3), optional, default: 2 (middle click)
1856
+ Mouse button used to stop input.
1857
+
1858
+ Returns
1859
+ -------
1860
+ points : list of tuples
1861
+ A list of the clicked (x, y) coordinates.
1862
+
1863
+ Notes
1864
+ -----
1848
1865
The keyboard can also be used to select points in case your mouse
1849
1866
does not have one or more of the buttons. The delete and backspace
1850
1867
keys act like right clicking (i.e., remove last point), the enter key
0 commit comments