title: Get access to the default LineStyleOrder and ColorOrder arrays in MATLAB
body: <p>Quick "convenience" question for MATLAB users. I am looping over a plot command, passing it different data to plot each time. The data happens to be generated from a function call, which upon each iteration is passed a different parameter value. To plot everything on the same axis I am using the 'hold' function. Unfortunately this doesn't auto cycle through the available ColorOrder and/or LineStyleOrder plot parameters, so every line plotted has the same style on every iteration. </p>
  
  
  
  <pre class="lang-ml prettyprint-override"><code>for i=1:nLines
      [x_data y_data]=get_xy_data(param1(i),param2(i))
      plot(x_data,y_data)
  end
  </code></pre>
  
  <p>Every line plotted will be the default blue line style. 
  The obvious solution is to generate up front a cell array of the various line styles, and colors as in:</p>
  
  <pre class="lang-ml prettyprint-override"><code>line_styles={'-','--','-*'}; %...etc
  colors=colormap(jet(nLines));
  </code></pre>
  
  <p>then access each of those on every iteration. What I want is access to the default colors which will be generated from ColorOrder, and the default line cycling, which comes from LineStyleOrder. If I try something like: </p>
  
  <pre class="lang-ml prettyprint-override"><code>get(gca,'LineStyleOrder')
  </code></pre>
  
  <p>This only returns the styles used in that axis (I've only tested this on an axis defined with one of the styles, but point is, it doesn't give me all possible linestyles). Help appreciated, thanks!</p>
  
  <p>EDIT: Let me be more specific in what I am looking for.</p>
  
  <pre class="lang-ml prettyprint-override"><code>figure; hold on;
  for i=1:nLines
      [xdata, ydata]=get_data(p1(i),p2(i))  % call some function to return x,y data
      plot(xdata,ydata) % on i=1, default blue line
  
      % function which tells matlab to get/set the next linestyle, color combination          
      nextStyle()       
  end
  </code></pre>
  
  <p>If this doesn't exist, it wouldn't be too hard to write it, but I thought I'd ask first before reinventing the wheel.</p>