How to set FaceAlpha of area plot
Show older comments
Hi, I run in some issues when I try to set the transparency of an area plot. I can set the transparency of the histogram but not of the area plot. Is this a bug? Version: R2015a 8.5.0.197613.
This is the code I used:
clc;clear;
figure
h = histogram(1:10);
h.FaceAlpha = 0.2;
grid
figure
a = area(1:10);
grid
a.FaceAlpha = 0.2;
This is the warning I get: "No public field FaceAlpha exists for class matlab.graphics.chart.primitive.Area."


Thanks
Accepted Answer
More Answers (1)
John BG
on 30 May 2016
In R2016a
your code works fine for both graphs.

Yet, you may want to control transparency separately:
clc;clear;
figure(1);
h = histogram(1:10);
h.FaceAlpha = 0.2;
grid
figure(2);
a = area(1:10);
grid
a.FaceAlpha = 0.8;

If you find this answer of any help solving your question,
please click on the thumbs-up vote link,
thanks in advance
John
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!