title: Matlab Plot is running really slow
body: <p>I recently got a gaming computer with an Intel i7 core, a GEFORCE GTX Nvidia 4GB graphics card, and 16GB RAM. I need to plot a graph with lots of points (around 50,000) and some specific points are marked with different colors. </p>
  
  <p>I can't even zoom in or move the graph around since it's running extremely slow. Is there any way to speed it up? It shouldn't be a problem for my computer, specially this simple graph...</p>
  
  <p>This is the code:</p>
  
  <pre><code>plot(1:length(real_slope),real_slope,'y-*',1:length(real_slope),Y,'r-*')
  hold on;
  candle(trade_high2(26:end),trade_low2(26:end),trade_close2(26:end),trade_open2(26:end));
  
  for i=2:length(OUT2)
  
      if Y(i) &gt; Y(i-1) + threshold
          if OUT2(i) &lt; OUT2(i-1)
              error_sum = error_sum + 1;
  
          end
          hold on;
          plot(i,Y(i),'x','LineWidth',5);
      end
  
      if Y(i) &lt; Y(i-1) - threshold
          if OUT2(i) &gt; OUT2(i-1)
              error_sum = error_sum + 1;
          end
          hold on;
          plot(i,Y(i),'x','LineWidth',5);
      end    
  
  
  end
  </code></pre>
  
  <p>Is there any way to speed up the process? I basically just want to graph a candlestick chart, and at the same time mark with a point (or an "x") some specific points in time. I am basically plotting these specific points as "plot(i,Y(i),'x','LineWidth',5);" within a for loop. Is there a more efficient way to mark those points?</p>