Hi Rajesh
the attached script example_color_bars.m generates 1 graph for 10 samples
1.
generating and visualising the data
clear all;close all;
a = -1;b = 1;
r=(b-a)*rand(10,5)+a
figure(1)
for k=1:1:10
subplot(5,2,k);ax1=stem(r(k,:)); axis([1 5 -1 1])
end
.
.
2.
calculating and plotting means and variance intervals
m=mean(r,2)
std=(var(r')').^.5
mtol=0.05
y=[-1*ones(10,1) m-std m-tol m+tol m+std ones(10,1)]
yd=diff(y,1,2);
x=[1:1:10];
figure(2);ax2=gca;
bh=barh(ax2,yd,.5,'stacked','EdgeColor','none');
bh(1).FaceColor=[.9 .9 .9];
bh(5).FaceColor=[.9 .9 .9];
bh(3).FaceColor=[.9 .4 .1];
bh(2).FaceColor=[.8 0 0];
bh(4).FaceColor=[.8 0 0];
ax2.XTickLabel={'-1' '-0.5' '0' '0.5' '1' '1.5'}
.
.
if you find this answer useful would you please be so kind to consider marking my answer as Accepted Answer?
To any other reader, if you find this answer useful please consider clicking on the thumbs-up vote link
thanks in advance
John BG