Why do I receive an error when I try to change the transparency property of my barseries object in MATLAB 7.0 (R14)?
16 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 27 de Jun. de 2009
Comentada: Steven Lord
el 16 de Dic. de 2018
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.
Respuesta aceptada
MathWorks Support Team
el 27 de Jun. de 2009
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);
1 comentario
Más respuestas (0)
Ver también
Categorías
Más información sobre Lighting, Transparency, and Shading en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!