我试图使用一个滑块来改变三维散点图中几个点的大小和颜色。我很困惑为什么颜色不会更新,而且我还没有找到一个命令来更新尺寸。在from mpl_toolkits.mplot3d import Axes3D
from matplotlib import pyplot
from matplotlib import pyplot as plt
from matplotlib.widgets import Slider
def on_change(val):
time=int(val)/1
point1.set_color(col[time][0])
point2.set_color(col[time][1])
#point1.size(sizes[time][0])
#point2.size(sizes[time][1])
fig.canvas.draw()
x=[[.3,.7],[.3,.7],[.3,.7]]
y=[[0.5,0.5],[0.5,0.5],[0.5,0.5]]
z=[[0.5,0.5],[0.5,0.5],[0.5,0.5]]
p=0
col=[['blue','red'],['green','green'],['red','blue']]
sizes=[[100,10],[55,55],[10,100]]
fig = pyplot.figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot([0,0,0,0,0,1,1,0,0,1,1,1,1,1,1,0],[0,1,1,0,0,0,0,0,1,1,0,0,1,1,1,1],[0,0,1,1,0,0,1,1,1,1,1,0,0,1,0,0]