title: matlab bar colormap returns the same color for all bars
body: <p>I have a problem with using <code>bar</code> and colormap.</p>
  
  <p>I have a csv file like this which contains completion time for six tasks:</p>
  
  <pre><code>34,22,103,22,171,26
  24,20,41,28,78,28
  37,19,60,23,141,24
  ...
  </code></pre>
  
  <p>and I create a bar chart with of the means, and add the std variation errorbar.</p>
  
  <pre><code>res = csvread('sorting_results.csv');
  figure();
  y = mean(res)';
  e = std(res);
  hold on;
  bar(y);
  errorbar(y,e,'.r');
  title('Sorting completion time');
  ylabel('Completion time (seconds)');
  xlabel('Task No.');
  hold off;
  colormap(summer(size(y,2)));
  </code></pre>
  
  <p>Why is the output like this? Why do the bars have the same color? And how do I put legends to the six bars?</p>
  
  <p><img src="https://i.stack.imgur.com/cDQeH.png" alt="enter image description here"></p>