MATLAB: Do I receive an error when I try to change the transparency property of the barseries object in MATLAB 7.0 (R14)

alphabarbarsbarserieshistogramMATLABtransparency

I execute the following code in MATLAB 7.0 (R14):
v1 = rand(81,1);
c1 = [1 0 1];
H1=histfit(v1);
set(H1(2),'Color',c1);
set(H1(1),'FaceColor',c1);
set(H1(1),'FaceAlpha',0.5);
I receive the following error message:
"??? There is no 'FaceAlpha' property in the 'barseries' class."
The above code executed without errors in previous versions of MATLAB.

Best Answer

In MATLAB 7.0 (R14) and higher versions, the barseries object is of type 'hggroup' instead of type 'patch' as in earlier versions. The 'FaceAlpha' property that you would like to change is a property of a patch object which is now a child of the barseries object of type 'hggroup'.
You will need to modify your code to change the transparency property of a barseries object as follows:
v1 = rand(81,1);
c1 = [1 0 1];
H1=histfit(v1);
set(H1(2),'Color',c1);
set(H1(1),'FaceColor',c1);
hpatch = get(H1(1),'children');
set(hpatch,'FaceAlpha',0.1);