在调用jupyter回调中的plot函数,以及在外部定义图形和轴并更新它们之前,我已经尝试了ax.cla()(和其他清除函数)
idmtrxlist包含带有位置数据的矩阵列表
def plotbird(posdata):
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
x = posdata[:,1]
y = posdata[:,2]
z = posdata[:,3]
ax.scatter(x, y, z, c='r', marker='o')
ax.set_xlabel('X Label')
ax.set_ylabel('Y Label')
ax.set_zlabel('Z Label')
exec("a = widgets.Dropdown(options="+str(idmtrxlist)+",value='pos15',description='Task:',)")
def on_change(change):
if change['type'] == 'change' and change['name'] == 'value':
exec("plotbird("+change['new']+")")
a.observe(on_change)
display(a)
我期望一个数字每次改变都会更新
目前没有回答
相关问题 更多 >
编程相关推荐