I cannot modify the 'FaceAlpha' property of my 'Rectangle' object

19 views (last 30 days)
When I create a rectangle using:
>> a=annotation('rectangle')
I can modify its 'FaceAlpha' property. However, when I create it using:
>> b=rectangle();
then there is no 'FaceAlpha' value for me to modify even though both "a" and "b" are shown as 'Rectangle' objects.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 19 Jul 2018
While both "a" and "b" are shown as 'Rectangle' objects in the Workspace, they actually come from two different classes, and therefore have different properties:
>> a = annotation('rectangle');
>> b = rectangle;
>> class(a)
ans =
'matlab.graphics.shape.Rectangle'
>> class(b)
ans =
'matlab.graphics.primitive.Rectangle'

More Answers (0)

Categories

Find more on Graphics Object Properties in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!