Making bar charts with error bars
In this recipe, we will show how to create bar charts and how to draw error bars.
Getting ready
To visualize uncertainty of measurement in our dataset or to indicate the error, we can use error bars. Error bars can easily give an idea of how error free the dataset is. They can show one standard deviation, one standard error, or 95 percent confidence interval. There is no standard here, so always explicitly state what values (errors) error bars display. Most papers in the experimental sciences should contain error bars to present accuracy of the data.
How to do it...
Even though just two parameters are mandatory—left
and height
— we often want to use more than that. Here are some parameters we can use:
width
: This gives the width of the bars. The default value is0.8
.bottom
: Ifbottom
is specified, the value is added to the height. The default isNone
.edgecolor
: This gives the color of the bar edges.ecolor
: This specifies the color of any error bar.linewidth...