title: Changing the size and color of points in a scatter plot using a slider in python
body: <p>I am attempting to use a slider to change both the size and color of several points in a 3d scatter plot. I am confused as to why the colors will not update, and I havn't been able to find a command to update the sizes.</p>
  
  <pre><code>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],c='black',zorder=10)
  point1=ax.scatter(x[p][0],y[p][0],z[p][0],s=sizes[p][0],color=col[p][0],zorder=0)
  point2=ax.scatter(x[p][1],y[p][1],z[p][1],s=sizes[p][1],color=col[p][1],zorder=0)
  ax.set_xlabel('Width')
  ax.set_ylabel('Depth')
  ax.set_zlabel('Height')
  slider_ax = plt.axes([0.15, 0.05, 0.7, 0.02])
  slider = Slider(slider_ax, "min", 0, 2, valinit=1, color='blue')
  slider.on_changed(on_change)
  pyplot.show()
  </code></pre>