title: R base function points() can be duplicated
body: <p>I have been trying to figure out why I can only see one of the two plots with the <em>points()</em> plotted.</p>
  
  <pre><code>set.seed(0)
  SSE &lt;- rep(0, 10)
  for (i in 1:10){
    km.out &lt;- kmeans(x = iris[,1:4], centers = 3, nstart = i)
    SSE[i] &lt;- km.out$tot.withins
  }
  plot(1:10, SSE, xlab = "k", ylab = "SSE", type = "b")
  km.out$cluster
  
  plot(iris[,1:2], col=(km.out$cluster+1), main="Best solution k = 3", xlab="x1", ylab="x2")
  points(km.out$centers, col = 1:2, pch = 8, cex = 2)
  
  plot(iris[,3:4], col=(km.out$cluster+1), main="Best solution k = 3", xlab="x1", ylab="x2")
  points(km.out$centers, col = c3:4, pch = 8, cex = 2) # didn't work, not sure why
  </code></pre>
  
  <blockquote>
    <p>First plot has the points.</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/CSEjC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CSEjC.png" alt="First plot"></a></p>
  
  <blockquote>
    <p>Second plot with no points plotted.</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/Iz0JU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Iz0JU.png" alt="Second plot"></a></p>
  
  <p>Does anyone know what I am doing wrong?</p>