Fixing color in scatter plots in matplotlib
Setting vmin and vmax should do this.
Here's an example:
import matplotlib.pyplot as plt
xyc = range(20)
plt.subplot(121)
plt.scatter(xyc[:13], xyc[:13], c=xyc[:13], s=35, vmin=0, vmax=20)
plt.colorbar()
plt.xlim(0, 20)
plt.ylim(0, 20)
plt.subplot(122)
plt.scatter(xyc[8:20], xyc[8:20], c=xyc[8:20], s=35, vmin=0, vmax=20)
plt.colorbar()
plt.xlim(0, 20)
plt.ylim(0, 20)
plt.show()
And the plot this produces: