title: Matplotlib: Getting different colors in data lines with error bars
body: <p>I am trying to draw two data lines with error bars, each having the same color as the data line. However, I get another thin line with a color I have not specified in each data line when I add an error bar.</p>
  
  <p>Also, I would like to make the caps of the error bars thicker but the option capthick is not valid here.</p>
  
  <p>Could anybody please help me fix these issues?</p>
  
  <p>This is my code.</p>
  
  <blockquote>
  <pre><code>import matplotlib.pyplot as plt
  from pylab import *
  import numpy as np
  
  xaxis = [1, 2, 3]
  mean1 = [1,2,3.6]
  se1 = [0.2, 0.5, 0.9]
  mean2 = [10, 29, 14]
  se2 = [3, 4, 2]
  
  fig = plt.figure()
  ax = fig.add_subplot(111)
  ax.set_xlabel('X', fontsize = 16)
  ax.set_ylabel('Y', fontsize = 16)
  
  ax.axis([0, 5, 0, 35])
  ax.plot(xaxis, mean1, 'r--', linewidth = 4)
  ax.errorbar(xaxis, mean1, yerr = se1, ecolor = 'r', elinewidth = 2, capsize = 5)
  ax.plot(xaxis, mean2, 'b--', linewidth = 4)
  ax.errorbar(xaxis, mean2, yerr = se2, ecolor = 'b', elinewidth = 2, capsize = 5)
  plt.show()
  </code></pre>
  </blockquote>
  
  <p><img src="https://i.stack.imgur.com/czT7V.png" alt=" "></p>