matplotlib.pyplot.waitforbuttonpress()函数
matplotlib.pyplot.waitforbuttonpress()方法
matplotlib库pyplot模块中的waitforbuttonpress()方法用于阻塞调用,以与图形交互。
语法:matplotlib.pyplot.waitforbuttonpress(超时= – 1)
参数:该方法接受以下参数:
- timeout:超时值。
返回:此方法不返回任何值。
下面的例子演示了matplotlib.pyplot.waitforbuttonpress()函数在matplotlib.pyplot中的作用:
示例1
输出:
示例2
输出: