matplotlib one data point with error bars
Question: How can I add asymmetric error bars to one data point using matplotlib python.
Right now I have something like

    
    
    x = 1
    
    y = 2
    
    yerr = 0.5
    
    pl.errorbar(x, y, yerr=[yerr, 2*yerr],fmt='o')
    

but I get

In safezip, `len(args[0])=1` but `len(args[1])=2`

Thanks!

(I tried the same plot line but with arrays for x and y and it works fine)


Answer: It is not very well documented, but `errorbar()` expects `yerr` to be a 2xN
array if you want asymmetrical errorbars. For example:

    
    
    import matplotlib.pyplot as plt
    
    fig = plt.figure()
    pl = fig.add_subplot(1, 1, 1)
    
    x = 1
    y = 2
    yerr = 0.5
    pl.errorbar(x, y, yerr=[[yerr], [2*yerr]],fmt='o')
    
    plt.savefig('t.png')
    

[![enter image description
here](http://i.stack.imgur.com/2cT92.png)](http://i.stack.imgur.com/2cT92.png)

