title: How does parameters 'c' and 'cmap' behave in a matplotlib scatter plot?
body: <p><strong>For the pyplot.scatter(x,y,s,c....) function ,</strong> </p>
  
  <p>The matplotlib docs states that : </p>
  
  <blockquote>
    <p>c : color, sequence, or sequence of color, optional, default: 'b' The
    marker color. Possible values:</p>
    
    <p>A single color format string. A sequence of color specifications of
    length n. A sequence of n numbers to be mapped to colors using cmap
    and norm. A 2-D array in which the rows are RGB or RGBA. Note that c
    should not be a single numeric RGB or RGBA sequence because that is
    indistinguishable from an array of values to be colormapped. If you
    want to specify the same RGB or RGBA value for all points, use a 2-D
    array with a single row.</p>
  </blockquote>
  
  <p><strong><em>However i do not understand how i can change the colors of the datapoints as i wish</em></strong> . </p>
  
  <p>I have this piece of code :</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import numpy as np
  import sklearn
  import sklearn.datasets
  import sklearn.linear_model
  import matplotlib
  
  
  %matplotlib inline
  matplotlib.rcParams['figure.figsize'] = (13.0, 9.0)
  
  # Generate a dataset and plot it
  np.random.seed(0)
  X, y = sklearn.datasets.make_moons(200, noise=0.55)
  print(y)
  plt.scatter(X[:,0], X[:,1], c=y)#, cmap=plt.cm.Spectral)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/PkIhs.png" rel="noreferrer">the output plot</a> </p>
  
  <p><strong>How can i change the colours to suppose black and green datapoints if i wish ? or something else ? Also please explain what exactly cmap does .</strong></p>
  
  <p><em>Why my plots are magenta and blue every time i use plt.cm.Spectral ?</em></p>