交互式意外关键字参数

Interactive unexpected keyword argument

我是 python 的新手,我正在编写在图表上的时间戳处显示球的代码。我想使用交互式小部件来显示球在图表上的移动方式。

def f(x):
    return matplotlib.pyplot.plot(ball.posx[x],ball.posy[x],'bo', markersize=5) #displaying current 
    
interactive(f, x=5);

但是,我收到此错误消息:

interactive() got an unexpected keyword argument 'x'

但是文档中是这么说的。我怎样才能解决这个问题? 谢谢

添加行:from ipywidgets import interact, interactive->interact