title: How to connect points together using plot
body: <p>I wrote some code that will searching for minimum of function using newton method. I've got some problem with plotting result. As a result I've got plot of not connected points but I want to get plot of connected points with the same colors. Can somebody tell me what is wrong with my code?</p>
  
  <pre><code>x = [[-1;-1],[-0.8;-0.8],[-0.6;-0.6],[-0.4;-0.4],[-0.2;-0.2],[0;0],[0.2;0.2],[0.4;0.4],[0.6;0.6],[0.8;0.8],[1;1]];
  eps = [0.1, 0.01, 0.001, 0.0001];
  
  f = @(x) x(1).^2 - 2.1*x(1).^4 + (x(1).^6)/3 + x(1)*x(2) - 4*x(2).^2 + 4*x(2).^4;
  
  for i=1:length(x)
  %    axis([0 0.001 0 100])
      colorVec = hsv(12);
  
      hold on;
      for e=1:length(eps)
          %fprintf('Starting point: %2.1f, %2.1f\n', x(:,i));
          %fprintf('Tollerance: %1.3f\n', eps(e));
          [r, iters] = NewtonMethod(f, x(:,i), eps(e), 100);
          plot(eps(e), iters, '-s', 'Color', colorVec(i,:))
      end
      hold off;
  
      xlabel('Tollerance')
      ylabel('Number of iterations')
      title('Title')
  end
  </code></pre>
  
  <p>Pic related: <a href="http://bayimg.com/AAodoaaFF" rel="nofollow">plot</a></p>