title: How to assign color to error bar caps? [Matplotlib]
body: <p>I am new at Matplotlib and would like to assign colors to error bar caps...in my data (attached) the mean values are 'numbers' and the SD ('error') is in the column 'sd'. I grouped data by 'strain' (4 categories; mc, mut1, etc.). Colors are 'strains' (lines). The code below works BUT When I use &quot;capsize&quot; to add caps it throws an error...</p>
  <p>I want the caps to have the same color as lines (from color vector &quot;c&quot;), any way? Thanks!</p>
  <p>The file is <a href="https://anonfiles.com/d8A7m4F5o0/mutdp_csv" rel="nofollow noreferrer">https://anonfiles.com/d8A7m4F5o0/mutdp_csv</a></p>
  <pre><code>muts = pd.read_csv('mutdp.csv')
  #SUBSET
  # Select rows (i.e. 1 to 28)
  gr=muts[1:28]
  
  fig, ax = plt.subplots(figsize=(12,9.9))
  
  c=['b','y','r','g']
  
  #Data GR ---------------------------------------------------------------------------------------------
  grstrain=gr.groupby(['time','strain']).mean()['numbers'].unstack()
  grstrain.plot.line(ax=ax, style=['-o','-o','-o','-o'],color=c, ls = '--', linewidth=2.7)
  
  # Error (-----HERE is where &quot;capsize&quot; causes the error----)
  ax.errorbar(gr.time, gr.numbers, yerr=gr.sd, ls='', color=[i for i in c for _i in range(7)], capsize=3, capthick=3)
  
  #(SCALE)
  plt.yscale('log')
  plt.ylim(0.04, 3)
  
  
  #SAVE FIG!
  
  plt.show() 
  </code></pre>