Summary
This explains the basics of making pretty bar plots in Matlab. The Matlab "bar" command is used, along with some nice scripts discovered on the Matlab file exchange.
Example
Suppose you have some experimental data from two strains (Strain 1 and Strain 2) under four different experiment conditions (Condition A,B,C,D). The means and standard deviations of your measurement of interest look like:
Strain1_Mean=[0.5137 3.2830 1.5887 5.9188];
Strain2_Mean=[0.4042 2.9884 0.5709 2.7766];
Strain1_std=[1.1393 2.8108 2.2203 3.5233];
Strain2_std=[0.8762 2.8478 0.9878 2.2197];
Use Matlab's bar command to plot this data (without error bars) as a bar chart:
bar([1 2 3 4],[Strain1_Mean' Strain2_Mean'])
legend('Strain 1','Strain 2')
pause; close all;
This looks ok, but we would really like some error bars, so we use a handy function (barwitherr) from the Matlab file exchange:
h=figure; hold;
barwitherr([Strain1_std' Strain2_std'], [1 2 3 4],[Strain1_Mean' Strain2_Mean'])
legend('Strain 1','Strain 2')
pause; close all;
This is ok, but we'd rather only have one-sided error bars. To do this, use a 4x2x2 matrix for the