Matplotlib.pyplot.waitforbuttonpress() in Python
Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. There are various plots which can be used in Pyplot are Line Plot, Contour, Histogram, Scatter, 3D Plot, etc.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course
The waitforbuttonpress() method in pyplot module of matplotlib library is used for blocking call to interact with the figure.
Syntax: matplotlib.pyplot.waitforbuttonpress(timeout=- 1)
Parameters: This method accept the following parameters that are discussed below:
- timeout: This parameter is the timeout value.
Returns: This method does not returns any value.
Below examples illustrate the matplotlib.pyplot.waitforbuttonpress() function in matplotlib.pyplot: