### Navigation

- index
- modules |
- next |
- previous |
- home|
- examples|
- tutorials|
- pyplot|
- docs »
- The Matplotlib API »
- matplotlib.pyplot »

# matplotlib.pyplot.waitforbuttonpress

`matplotlib.pyplot.``waitforbuttonpress`(*args, **kwargs)

  Blocking call to interact with the figure.

  This will return True is a key was pressed, False if a mouse button was pressed and None if timeout was reached without either being pressed.

  If timeout is negative, does not timeout.

## Examples using `matplotlib.pyplot.waitforbuttonpress`

Interactive functions