Asymmetric Error Bars Matplotlib
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack
Python Errorbar Legend
Overflow the company Business Learn more about hiring developers or posting ads with us
Matplotlib Error Bars Scatter Plot
Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community matplotlib plt of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up matplotlib bar with asymmetrical error bars up vote 6 down vote favorite 1 I need to http://matplotlib.org/examples/statistics/errorbar_demo_features.html plot a bar graph with asymmetrical error bars... The documentation of the matplotlib.pyplot.bar function says: Detail: xerr and yerr are passed directly to errorbar(), so they can also have shape 2xN for independent specification of lower and upper errors. But, I can not give an 2xN array to the yerr... import numpy as np import matplotlib.pyplot as plt plt.bar(xrange(5), [2,5,3,4,7], yerr=[[1,4,2,3,6],[4,10,6,8,14]]) #DO NOT work! And show me the following error: Traceback http://stackoverflow.com/questions/13130703/matplotlib-bar-with-asymmetrical-error-bars (most recent call last): File "bar_stacked.py", line 9, in
here for a quick overview of the site Help Center Detailed answers http://stackoverflow.com/questions/31812469/plotting-asymmetric-error-bars-for-a-single-point-using-errorbar to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack error bars Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Plotting asymmetric error bars for a single point using errorbar up vote 2 down vote favorite 1 Goal: To plot asymmetric x error bars asymmetric error bars for a single point using errorbar. I want to display the inter quartile range (IQR) for a data set. Code: import numpy as np import matplotlib.pyplot as plt y = 1.0 data = np.random.rand(100) median = np.median(data) upper_quartile = np.percentile(data, 75) lower_quartile = np.percentile(data, 25) IQR = upper_quartile - lower_quartile plt.errorbar(median, y, xerr=[lower_quartile ,upper_quartile], fmt='k--') plt.savefig('IQR.eps') plt.show() Error: Traceback (most recent call last): File "IQR.py", line 15, in