title: Why do my centroids lies on the graph axis in MATLAB using k-means clustering?
body: <p>I am trying to do a very simple k-means clustering in MATLAB and have a dataset of 732 x 1. I used the code below to generate the graph however, the position of centroids keeps landing on the y-axis which doesn't make any sense.  If I were to just plot <code>C</code> without using the <code>hold</code> function the centroids appears to be in positions other than the axis. I can't figure out what is wrong here. </p>
  
  <p>Here's the code that I wrote to reproduce my problem:</p>
  
  <pre><code>figure;
  [idx,C,sumd,D] = kmeans(EnginePower,6,'start','uniform','Distance','cityblock','Replicates',10,'display','iter');
  
  plot(C(:,1),'kx','MarkerSize',15,'LineWidth',3)
  hold on
  plot(Time(:,2),EnginePower,'.');
  hold off
  </code></pre>