title: How can I normalize colormap in matplotlib scatter plot?
body: <p>The <a href="http://matplotlib.org/users/colormapnorms.html" rel="noreferrer">matplotlib documentation</a> explain in detail how to normalize colormaps for a pcolormesh, but how can I correctly do it for a scatter plot?</p>
  
  <pre><code>normalize = mcolors.Normalize(vmin=-1, vmax=1)
  plt.scatter(x,y,z,cmap=colormap(normalize),marker='*',s=5)
  </code></pre>
  
  <p>doesn't work (<code>TypeError: Cannot cast array data from dtype('O') to dtype('int64') according to the rule 'safe'</code>)</p>
  
  <p>it's just that the z data are not exactly from -1 to 1, I am plotting multiple datasets that have the limits around +/- 0.93 - 98, but I want the colours to be centered at zero and go from -1 to 1 so that I have the same reference for all the various datasets.</p>
  
  <p>Oh, and when I don't attempt to normalize, I get <code>TypeError: scatter() got multiple values for keyword argument 's'</code>. Clearly I don't know how to use colormap in scatter plots.</p>