Borrowing from the example on the Matplotlib documentation page and slightly modifying the code,
import numpy as np from mpl_toolkits.mplot3d import Axes3D i
This produces a colorbar (though possibly not the one you need):
Replace this line:
ax.scatter(xs, ys, zs, c=cs, marker=m)
with
p = ax.scatter(xs, ys, zs, c=cs, marker=m)
then use
fig.colorbar(p)
near the end