I am now plotting some bars and pictures for use in presentation. Really interested in different ways of showing confidence intervals on the plots.
As Aaron has pointed out, it is not quite clear what you are actually asking for.
Here is an example of bars with confidence intervals, which I think does the job
It was produced in R using the package
ggplot2 and the following code based on the example in the help page for
library(ggplot2) df <- data.frame( trt = factor(c(1, 1, 2, 2)), resp = c(1, 5, 3, 4), group = factor(c(1, 2, 1, 2)), se = c(0.1, 0.3, 0.3, 0.2) ) # Define the top and bottom of the errorbars ci <- aes(ymax = resp + 1.96*se, ymin=resp - 1.96*se) p <- ggplot(df, aes(fill=group, y=resp, x=trt)) # Because the bars and errorbars have different widths # we need to specify how wide the objects we are dodging are dodge <- position_dodge(width=0.9) p + geom_bar(position=dodge) + geom_errorbar(ci, position=dodge, width=0.25)
If you like to do it in MATLAB, you can use errorbar. Alternatively, you may check the confidence interval plotting utilities in MATLAB file exchange. For instance, errorb is a nice function to do different types of confidence interval plots.
clc, clear, close y=rand(1,5)+1; e=rand(1,5)/4; hold off; bar(y,'facecolor',[.8 .8 .8]); hold on; errorb(y,e); figure x=linspace(0,2*pi,8); y=sin(x); e=rand(1,8)/4; hold off; plot(x,y,'k','linewidth',2); hold on; errorb(x,y,e) figure values=abs(rand(2,3))+1; errors=rand(2,3)/1.5+0; errorb(values,errors,'top');