Plotting asymmetric error bars Matplotlib
<p>So I have three sets of data:</p>

<pre><code>min_data = np.array([ 0.317, 0.312, 0.305, 0.296, 0.281, 0.264, 0.255, 
0.237, 0.222, 0.203, 0.186, 0.17, 0.155, 0.113, 0.08])

avg_data = np.array([ 0.3325, 0.3235, 0.3135, 0.30216667, 0.2905, 0.27433333, 
0.26116667, 0.24416667, 0.22833333, 0.20966667, 0.19366667, 0.177, 
0.16316667, 0.14016667, 0.097])

max_data = np.array([ 0.346, 0.331, 0.32, 0.31, 0.299, 0.282, 0.266, 0.25, 
0.234, 0.218, 0.204, 0.187, 0.175, 0.162, 0.115])
</code></pre>

<p>I need to plot this data with error bars. </p>

<p>I have attempted:</p>

<pre><code>x = np.linspace(0, 100, 15)
err = [min_data, max_data]
plt.errorbar(x, avg_data, 'bo', yerr=err)

TypeError: errorbar() got multiple values for argument 'yerr'
</code></pre>

<p>The final graph should look like this:</p>

<pre><code>plt.plot(x[::-1], avg_data, 'ro')
plt.plot(x[::-1], min_data, 'bo')
plt.plot(x[::-1], max_data, 'bo')
</code></pre>

<p><a href="https://i.stack.imgur.com/JTZAK.png" rel="nofollow"><img src="https://i.stack.imgur.com/JTZAK.png" alt="enter image description here"></a></p>

<p>Where the blue points represent where the error bars should be located.</p>

<p>All the documentation I have been able to find only allows asymmetric errors that is equal in + and - y directions.</p>

<p>Thank you</p>

<p>Your code is failing because it thinks that <code>'bo'</code> is the <code>yerr</code> argument since the third argument in <code>plt.errorbar</code> is <code>yerr</code>.  If you want to pass the format specifier, then you should use the <code>fmt</code> keyword.  </p>

<pre><code>plt.errorbar(x, avg_data, fmt='bo', yerr=err)
</code></pre>

python numpy matplotlib